Skip to content

fix(backend): enforce dead letter consistency rule for delivery ID an… - #1430

Merged
github-actions[bot] merged 1 commit into
ritik4ever:mainfrom
ugoocreates-pixel:fix/dead-letters-consistency-ssb-2026-158
Oct 25, 2026
Merged

github-actions[bot] merged 1 commit into
ritik4ever:mainfrom
ugoocreates-pixel:fix/dead-letters-consistency-ssb-2026-158

Conversation

@ugoocreates-pixel

Copy link
Copy Markdown
Contributor

Summary

Enforces the consistency rule for webhook dead letters across handler responses, worker transitions, operator requeue workflows, and monitoring documentation as defined in SSB-2026-158.

Key Changes

  1. Committed State Reflection & Delivery ID Consistency:

    • In backend/src/services/webhook.ts, requeueDeadLetter captures the newly generated delivery ID from SQLite's lastInsertRowid upon successfully committing the restored delivery, emitting structured outcome signals with deliveryId.
    • In backend/src/services/webhookWorker.ts, dead-letter storage transition executes atomically within a single db.transaction(...), preserving the original deliveryId and ensuring the terminal failureReason matches between stored dead letters and structured outcome logs.
  2. No Claimed State Changes on Failure:

    • Worker crashes, restarts, or transaction aborts during dead-letter transition roll back cleanly, ensuring active deliveries remain pending without creating partial or duplicate dead-letter rows.
    • Non-existent dead letters or database aborts during requeue return false without claiming a state change or mutating stored records.
  3. Tests & Documentation:

    • Added unit and consistency tests in backend/src/services/webhook.test.ts and backend/src/services/webhookWorker.test.ts verifying delivery ID retention, consistent failure reasons, and error boundary safety.
    • Formally documented the dead letter consistency rule in docs/webhook-monitoring.md.

Project area: backend · Batch ID: SSB-2026-158

Closes #1101

@vercel

vercel Bot commented Oct 25, 2026

Copy link
Copy Markdown

@ugoocreates-pixel is attempting to deploy a commit to the ritik4ever's projects Team on Vercel.

A member of the Team first needs to authorize it.

@coderabbitai

coderabbitai Bot commented Oct 25, 2026

Copy link
Copy Markdown

Important

  • 🔍 Trigger review

This repository does not receive automatic reviews because it has fewer than 10 stars.

Run configuration
  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: df5d4721-7f8c-4c63-8edf-a0f5ce745938
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@github-actions
github-actions Bot merged commit dfd6926 into ritik4ever:main Oct 25, 2026
2 of 3 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

Development

Successfully merging this pull request may close these issues.

[DATA] Keep Webhook dead letters results consistent

1 participant