Fix/pgboss crashloop redundant index#14
Merged
Merged
Conversation
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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.