Skip to content

Fix/pgboss crashloop redundant index#14

Merged
ripgrim merged 2 commits into
mainfrom
fix/pgboss-crashloop-redundant-index
Jul 24, 2026
Merged

Fix/pgboss crashloop redundant index#14
ripgrim merged 2 commits into
mainfrom
fix/pgboss-crashloop-redundant-index

Conversation

@ripgrim

@ripgrim ripgrim commented Jul 24, 2026

Copy link
Copy Markdown
Collaborator

No description provided.

ripgrim and others added 2 commits July 23, 2026 22:26
four fixes from one debugging session, confirmed against prod (read-only)
on scratch #83.

- resume: the verdict is the maintainer's decision, not graph traversal.
  deny always blocks — a deny edge drawn to a non-block action (discord),
  or to nowhere, no longer resumes to pass. side-effect edges still conduct;
  a block action floors in when the graph produced none. approve resumes to
  the graph's verdict. extracted resolveResumeOutcome (pure, unit-tested).
- rules: the "edit in workflow" link built the definition wire id, not the
  editor's row id (two separate generateId() calls at create), so it 404'd.
  map wire->row via listEnabledWorkflowRows.
- run view: resumed steps carry a :resume suffix the snapshot label map
  lacks — strip it so the moderation node and its actions label correctly;
  label the synthetic deny-floor step as block.
- moderation queue: toast names the outcome, not the mechanism.

regression: resume-verdict.test.ts covers deny -> non-block action -> block.
moderation.integration.test.ts needs docker; ci runs it.
…ons index

A transient Postgres read-only window (PlanetScale failover, code 25006)
crash-looped the worker: pg-boss emits an EventEmitter 'error' with no
listener, so Node rethrows it as ERR_UNHANDLED_ERROR and the process exits
(observed: 9 restarts in 2 minutes). createBoss now always attaches a
boss.on('error') handler so both the worker and api heads log the blip and
ride out the failover instead of crashing; recovery is automatic once the DB
returns to read-write.

Also drops run_actions_run_idx (run_id) — fully redundant with the
run_actions_idempotency_unique (run_id, idempotency_key) left prefix. One
fewer index to maintain on the hot record→execute write path. Applied via
the normal migrate.ts deploy path (migration 0018).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@ripgrim
ripgrim merged commit 5996a89 into main Jul 24, 2026
1 check failed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant