Skip to content

Fix: 4 issues (#1522, #1523, #1524, #1525) - #1654

Merged
Mystery-CLI merged 2 commits into
Ethereal-Future:mainfrom
temma02:simple/1522-1523-1524-1525
Oct 18, 2026
Merged

Mystery-CLI merged 2 commits into
Ethereal-Future:mainfrom
temma02:simple/1522-1523-1524-1525

Conversation

@temma02

@temma02 temma02 commented Oct 18, 2026

Copy link
Copy Markdown
Contributor

Closes #1522
Closes #1523
Closes #1524
Closes #1525

Issues

#1522 backend/src/db/encryption.js: Missing closing brace in encryptSearchable causes syntax error

Domain: Backend & Security | Complexity: Low | Tracking ID: ISSUE-208

Background

In backend/src/db/encryption.js, the encryptSearchable function at line 43 is missing its closing brace.

Problem

This leaves the function body open and causes subsequent exports to fail parsing with SyntaxError: Unexpected token 'export'.

Proposed Solution / Remediation

Insert the closing brace } for encryptSearchable before the next exported function.

Acceptance Criteria

  • node --check backend/src/db/encryption.js exits 0.
  • Searchable encryption utility functions execute correctly.

#1523 backend/src/db/softDelete.js: Missing opening comment delimiter /** corrupts AST parsing

Domain: Backend & Database | Complexity: Low | Tracking ID: ISSUE-209

Background

In backend/src/db/softDelete.js at line 23, an unclosed comment block begins with * instead of /**.

Problem

The parser treats subsequent comment lines as arithmetic multiplication operations, throwing SyntaxError: Unexpected token '*'.

Proposed Solution / Remediation

Restore the proper /** opening delimiter for the JSDoc comment.

Acceptance Criteria

  • node --check backend/src/db/softDelete.js passes cleanly.
  • Soft delete Prisma middleware loads without parsing errors.

#1524 backend/src/auth/sessionStore.js: Missing closing brace in session cleanup before import statement

Domain: Backend & Auth | Complexity: Low | Tracking ID: ISSUE-210

Background

In backend/src/auth/sessionStore.js, the session cleanup method right before line 29 lacks a closing brace }.

Problem

Because static import statements cannot appear inside function bodies in JavaScript, Node throws SyntaxError: Unexpected reserved word 'import'.

Proposed Solution / Remediation

Close the method body before line 29 or move top-level imports to the module header.

Acceptance Criteria

  • node --check backend/src/auth/sessionStore.js passes.
  • Session store initializes and manages sessions without syntax errors.

#1525 backend/src/auth/tokens.js: Unclosed function block in verifyRefreshToken causes syntax error

Domain: Backend & Auth | Complexity: Low | Tracking ID: ISSUE-211

Background

In backend/src/auth/tokens.js, verifyRefreshToken is missing its closing brace prior to the definition of constants at line 42.

Problem

This causes subsequent export statements to be trapped inside the function body, leading to SyntaxError: Unexpected token 'export'.

Proposed Solution / Remediation

Add the closing brace to verifyRefreshToken to properly enclose its implementation.

Acceptance Criteria

  • node --check backend/src/auth/tokens.js exits with code 0.
  • Token signing and refresh token verification operate as expected.

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 --check on each file after editing.

Changes

  • In backend/src/db/encryption.js, the encryptSearchable function is missing its closing brace. After the return statement of encryptSearchable, a JSDoc comment block begins with a stray * 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 second import { 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 with node --check backend/src/db/encryption.js and exercise the searchable encryption helpers. (backend/src/db/encryption.js)
  • In backend/src/db/softDelete.js, the JSDoc comment block after assertUniqueActive opens with a stray * 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 with node --check backend/src/db/softDelete.js and confirm the Prisma soft-delete middleware loads. (backend/src/db/softDelete.js)
  • In backend/src/auth/sessionStore.js, the createSession function (and the surrounding module) is missing closing braces: createSession is not closed before a second 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 with node --check backend/src/auth/sessionStore.js and confirm session initialization works. (backend/src/auth/sessionStore.js)
  • In backend/src/auth/tokens.js, verifyRefreshToken is missing its closing brace before the constants at line 42, trapping subsequent export statements inside the function and causing SyntaxError: Unexpected token 'export'. The file also contains a duplicated second implementation of signAccessToken, signRefreshToken, verifyToken, verifyRefreshToken, etc. Fix by: (1) adding the missing } 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 with node --check backend/src/auth/tokens.js and confirm token signing and refresh verification still work. (backend/src/auth/tokens.js)

Co-authored-by: Simple Agent <agent@simple.dev>
@temma02
temma02 requested a review from Mystery-CLI as a code owner October 18, 2026 14:15
@drips-wave

drips-wave Bot commented Oct 18, 2026

Copy link
Copy Markdown

@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! 🚀

Learn more about application limits

@Mystery-CLI
Mystery-CLI merged commit a155795 into Ethereal-Future:main Oct 18, 2026
8 of 47 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

2 participants