When dryRun is true, deleteAccount logs the preview and carries on to database.deleteAccount, because the dry-run branch never returns.
Impact
A dry run deletes the account it was meant to preview, and the audit log records the deletion as real.
Recommended solution
Return straight after logging the preview, or move the deletion into an explicit else branch, and add a test that a dry run leaves the account in place.
Why this was flagged
Check findings at these lines
No check finding in this report is at these lines. This finding comes from the AI review reading the source below.
Source the review cited
src/accounts/delete-account.ts:14-19
Limits
The AI review reads selected excerpts of the repository, not every file. This finding is a reviewed judgement about the lines above, not a deterministic match.
This finding has no identity that carries across scans, so it can’t be suppressed on its own.
2 of 28 deterministic checks did not complete for this revision, so other signals for these lines may be missing.
Invoice export checks session expiry with its own rule
Two places decide when a session expires
Two places decide when a session expires. 3 reviewed components and 2 reviewed relationships. Export route reads the session cookie (src/routes/billing.ts:22–25) leads to Export handler checks idle time itself (src/billing/export-invoices.ts:27–29): Passes a raw session id (src/routes/billing.ts:23). Export handler checks idle time itself (src/billing/export-invoices.ts:27–29) leads to Auth defines expiry and revocation (src/auth/sessions.ts:13–18): Uses 30 minutes and skips revocation (src/billing/export-invoices.ts:29).
Export route reads the session cookieSourcesrc/routes/billing.ts:22–25
Export handler checks idle time itselfSourcesrc/billing/export-invoices.ts:27–29
Auth defines expiry and revocationSourcesrc/auth/sessions.ts:13–18
Reviewed relationships
Export route reads the session cookieExport handler checks idle time itself
Passes a raw session idRelationship sourcesrc/routes/billing.ts:23
Export handler checks idle time itselfAuth defines expiry and revocation
Uses 30 minutes and skips revocationRelationship sourcesrc/billing/export-invoices.ts:29
Problem
The export route passes the raw session id to the export handler, which reads the session row and applies its own 30-minute idle limit with no revocation check, instead of calling isSessionActive.
Impact
A revoked session, or one idle for 20 to 30 minutes, can still export invoices after the rest of the service has signed it out.
Recommended solution
Check the session with isSessionActive before exporting, and keep the expiry rule, timeout included, in the auth module.
Why this was flagged
Check findings at these lines
No check finding in this report is at these lines. This finding comes from the AI review reading the source below.
Source the review cited
src/billing/export-invoices.ts:27-29
src/routes/billing.ts:22-25
src/auth/sessions.ts:13-18
Limits
The AI review reads selected excerpts of the repository, not every file. This finding is a reviewed judgement about the lines above, not a deterministic match.
This finding has no identity that carries across scans, so it can’t be suppressed on its own.
2 of 28 deterministic checks did not complete for this revision, so other signals for these lines may be missing.
invoiceTotals awaits exchangeRates.fetchRate inside the loop, so it sends one request per invoice and each request waits for the one before it.
Impact
The endpoint slows down as invoice lists grow and asks again for currency pairs it has already fetched. How much that matters depends on typical list sizes and the rate service's limits.
Recommended solution
Fetch each distinct currency pair once before the loop, or use a batch lookup if the rate service has one, then measure the endpoint with a realistic number of invoices.
Why this was flagged
Check
Network requests in a loop matched src/billing/invoice-totals.ts:23-24. Report this finding as a false positive to suppress it.
Source read for this finding
src/billing/invoice-totals.ts:21-28
Limits
2 of 28 deterministic checks did not complete for this revision, so other signals for these lines may be missing.
See what turns up in your own code.
Create an account, pick a repository, and SlopCop starts indexing it.