Skip to content

fix: resolve issues #50, #51, #52, #53 - #149

Merged
Busiii-adetiba merged 2 commits into
SynapsVault:mainfrom
villadel:fix/issues-50-51-52-53
Oct 20, 2026
Merged

Busiii-adetiba merged 2 commits into
SynapsVault:mainfrom
villadel:fix/issues-50-51-52-53

Conversation

@villadel

Copy link
Copy Markdown
Contributor

#50 — Admin delist audit record

  • adminDelistResource writes a moderation_events row with action, resource id, optional reason, and actor (admin key digest)
  • admin.ts POST /admin/delist/:id passes reason + actor to service
  • schema.ts: moderationEvents table added
  • drizzle/0012_moderation_events.sql: migration for new table

#51 — Admin delist lock flag

  • handleSetListedEvent: guards re-listing with isNull(adminDelistedAt) so chain sync cannot undo an admin delist (listing=false still allowed)
  • verify.ts: pre-payment check already blocks admin-delisted resources and the UPDATE WHERE clause includes isNull(adminDelistedAt)

#52 — /debug/db route security

  • health.ts: /debug/db returns 404 unless ENABLE_DEBUG_ROUTES=true and requires X-Admin-Key matching ADMIN_API_KEY (constant-time compare)

#53 — uncaughtException process exit

  • index.ts: uncaughtException handler flushes Sentry (2 s timeout) then calls process.exit(1) so the platform can restart the service

Tests

  • src/routes/admin.test.ts: fixed router mount path, db mock chain, and module isolation; all 9 tests pass
  • src/services/resourceService.admin-delist.test.ts: added workerQueue mock, corrected createFileResource signature; all 7 tests pass
  • src/workers/eventListener.admin-lock.test.ts: rewrote to eliminate conflicting double vi.mock for db/client; all 6 tests pass
  • src/index.uncaught.test.ts: new file; 1 test passes

.gitignore updated with test snapshot patterns, editor/OS files, and build artefacts to keep the branch clean.

close #50
close #51
close #52
close #53

…ynapsVault#53

SynapsVault#50 — Admin delist audit record
- adminDelistResource writes a moderation_events row with action,
  resource id, optional reason, and actor (admin key digest)
- admin.ts POST /admin/delist/:id passes reason + actor to service
- schema.ts: moderationEvents table added
- drizzle/0012_moderation_events.sql: migration for new table

SynapsVault#51 — Admin delist lock flag
- handleSetListedEvent: guards re-listing with isNull(adminDelistedAt)
  so chain sync cannot undo an admin delist (listing=false still allowed)
- verify.ts: pre-payment check already blocks admin-delisted resources
  and the UPDATE WHERE clause includes isNull(adminDelistedAt)

SynapsVault#52 — /debug/db route security
- health.ts: /debug/db returns 404 unless ENABLE_DEBUG_ROUTES=true
  and requires X-Admin-Key matching ADMIN_API_KEY (constant-time compare)

SynapsVault#53 — uncaughtException process exit
- index.ts: uncaughtException handler flushes Sentry (2 s timeout)
  then calls process.exit(1) so the platform can restart the service

Tests
- src/routes/admin.test.ts: fixed router mount path, db mock chain,
  and module isolation; all 9 tests pass
- src/services/resourceService.admin-delist.test.ts: added workerQueue
  mock, corrected createFileResource signature; all 7 tests pass
- src/workers/eventListener.admin-lock.test.ts: rewrote to eliminate
  conflicting double vi.mock for db/client; all 6 tests pass
- src/index.uncaught.test.ts: new file; 1 test passes

.gitignore updated with test snapshot patterns, editor/OS files,
and build artefacts to keep the branch clean.
@vercel

vercel Bot commented Oct 20, 2026

Copy link
Copy Markdown

@villadel is attempting to deploy a commit to the work Team on Vercel.

A member of the Team first needs to authorize it.

@drips-wave

drips-wave Bot commented Oct 20, 2026

Copy link
Copy Markdown

@villadel 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

@Busiii-adetiba
Busiii-adetiba merged commit 15407eb into SynapsVault:main Oct 20, 2026
0 of 2 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