Repository navigation
Fix: 4 issues (#1522, #1523, #1524, #1525) - #1654
Merged
Mystery-CLI merged 2 commits intoOct 18, 2026
Merged
Conversation
Co-authored-by: Simple Agent <agent@simple.dev>
|
@temma02 Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits. You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #1522
Closes #1523
Closes #1524
Closes #1525
Issues
#1522 backend/src/db/encryption.js: Missing closing brace in encryptSearchable causes syntax error
#1523 backend/src/db/softDelete.js: Missing opening comment delimiter /** corrupts AST parsing
#1524 backend/src/auth/sessionStore.js: Missing closing brace in session cleanup before import statement
#1525 backend/src/auth/tokens.js: Unclosed function block in verifyRefreshToken causes syntax error
Summary
Each file contains a duplicated second implementation concatenated after the first, which is the underlying cause of the unbalanced braces and stray comment delimiters. The fix must both restore the missing brace/delimiter and remove the duplicate module body so each file parses as a single coherent module. Run
node --checkon each file after editing.Changes
*instead of/**, and a second copy of the module (imports, encrypt, decrypt, getKeyRing, etc.) is concatenated into the file. Restore valid syntax by: (1) adding the missing}to close encryptSearchable immediately after its return statement; (2) replacing the stray*line with a proper/**opening delimiter so the following comment lines are parsed as a comment; (3) removing the duplicated second implementation (the secondimport { createCipheriv, ... }block and all subsequent duplicate declarations) so the file contains exactly one coherent module with the original exports (encrypt, decrypt, normalize, generateBlindIndex, encryptSearchable). Verify withnode --check backend/src/db/encryption.jsand exercise the searchable encryption helpers. (backend/src/db/encryption.js)*instead of/**, so the comment text is parsed as multiplication and throws SyntaxError: Unexpected token '*'. Restore the proper/**opening delimiter for that comment block. Also note the file contains a duplicated second implementation of the soft-delete extension (SOFT_DELETE_MODELS, createSoftDeleteExtension, hardDelete, restoreDeleted, etc.); remove the duplicate so the module has a single coherent set of exports. Verify withnode --check backend/src/db/softDelete.jsand confirm the Prisma soft-delete middleware loads. (backend/src/db/softDelete.js)import prisma from '../db/client.js'statement appears, which is illegal inside a function body and causes SyntaxError: Unexpected reserved word 'import'. The file also contains a duplicated second implementation of createSession, getActiveSession, revokeSession, revokeAllSessions, etc. Fix by: (1) adding the missing}to close createSession after its return statement; (2) removing the duplicated second implementation and the duplicate top-level import so the module has a single coherent set of exports (createSession, getActiveSession, revokeSession, revokeAllSessions, listUserSessions) with all imports at the module header; (3) ensuring getActiveSession and revokeAllSessions are properly closed. Verify withnode --check backend/src/auth/sessionStore.jsand confirm session initialization works. (backend/src/auth/sessionStore.js)}to close verifyRefreshToken after its return statement; (2) removing the duplicated second implementation so the module has a single coherent set of exports (signAccessToken, signRefreshToken, verifyToken, verifyAccessToken, verifyRefreshToken). Verify withnode --check backend/src/auth/tokens.jsand confirm token signing and refresh verification still work. (backend/src/auth/tokens.js)