Description
Refuse to serve traffic against a schema that may be missing required tables.
Problem Statement
startServer swallows migration failure outright (index.js:131-136):
catch (migrationErr) {
logger.error({ error: migrationErr.message }, '[startup] Database migrations failed — continuing');
}
The server then binds the port and accepts /github-webhook requests against a schema that may be missing the retry_state table entirely. Every subsequent initRetryState / recordRetry throws — and those throws are themselves swallowed as "non-fatal" in src/workers/event-worker.js:53-55 and :82-84.
Net effect: merged PRs are accepted with 202 { ok: true, queued: true }, then fail to register with no durable retry record — a silent, payment-affecting data-loss path.
Proposed Changes
Technical Implementation Scaffolding
- Target Repository: vero-relayer-service
- Target Path: index.js, src/workers/event-worker.js
- Branch Naming: fix/issue--fail-startup-on-migration-failure
- Authority Context: Reliability — silent loss of merged-PR registrations
Acceptance Criteria
Definition of Done
Description
Refuse to serve traffic against a schema that may be missing required tables.
Problem Statement
startServerswallows migration failure outright (index.js:131-136):The server then binds the port and accepts
/github-webhookrequests against a schema that may be missing theretry_statetable entirely. Every subsequentinitRetryState/recordRetrythrows — and those throws are themselves swallowed as "non-fatal" insrc/workers/event-worker.js:53-55and:82-84.Net effect: merged PRs are accepted with
202 { ok: true, queued: true }, then fail to register with no durable retry record — a silent, payment-affecting data-loss path.Proposed Changes
process.exit(1)) on migration failure instartServer, so a bad deploy fails loudly and the orchestrator doesn't route traffic to itstartEventWorker— a worker with noretry_statetable cannot do its job/healthreportDEGRADEDwhile activeTechnical Implementation Scaffolding
Acceptance Criteria
npm startexits non-zero and never binds the port/healthreturns 503 whenever migration state is unknown or incompleteDefinition of Done