Repository navigation
fix(marketplace): consume the agreement-event dead-letter queue - #189
Merged
Merged
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub. 2 Skipped Deployments
|
stewartjarod
approved these changes
Oct 6, 2026
Contributor
Author
|
This pull request is waiting on a decision: merge it if the change is still wanted, or close it if the fix is no longer needed. Either one settles it. It was opened on 2026-09-30 and has had no new activity for a week. If nothing happens on it within a week, Polylane closes it and keeps the branch, so reopening it brings the change back exactly as it stands. |
…tter queue Co-authored-by: polylane[bot] <277585245+polylane[bot]@users.noreply.github.com>
stewartjarod
force-pushed
the
polylane/autofix/xs41wzfia9d7
branch
from
October 17, 2026 20:21
920459d to
24b4a29
Compare
The main worker swallows per-record errors, so what dead-letters is a whole batch whose Lambda timed out or crashed. Records earlier in that batch may already have been applied, and failing them would mark a live subscription failed. Guard the update on status = pending and surface settled rows to Sentry without touching them. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_014QZmHPbcx2nhuuDHy86YQ2
…hem (#195) The worker caught every per-record error, logged it, and returned success, so SQS deleted the message. A transient database error on an activation never reached the retries or the dead-letter queue, and the buyer stayed pending. Report failed records as batch item failures (partialResponses is already on) so SQS retries just those and dead-letters them once spent. Claude-Session: https://claude.ai/code/session_014QZmHPbcx2nhuuDHy86YQ2 Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
This branch was previously deployed
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.
Fixes: Marketplace dead-letter queue has no consumer (failed agreement events expire unprocessed)
The AWS Marketplace agreement-event pipeline had a dead-letter queue that nothing read, so an event that exhausted its SQS retries was never reprocessed and was deleted when its 14-day retention lapsed. A buyer's subscription could therefore stay incomplete with no signal a human could act on. This adds the missing dead-letter consumer, which marks the affected subscription failed so the failure surfaces instead of vanishing.
Detection evidence
Affected:
acc_04a3bad4f001h13i5u6ajeodWhy this fix
Both sibling dead-letter queues (batch and workflow) already subscribe a consumer; the marketplace one did not, so the main queue redrived into a queue no Lambda was attached to. The worker's own header names that DLQ as its only retry, and the subscription schema documents a
failedstatus that no code ever wrote. The new consumer correlates each dead-lettered event and moves the subscription tofailed, the terminal state the schema reserves for this. It deliberately does not re-enqueue, which would risk a queue/DLQ loop on a record that fails deterministically; automatic reprocessing remains an open decision recorded on the issue.Causal chain
5 files changed (+492/-128)
apps/api/src/services/marketplace-event.ts: added, +140/-0apps/api/src/workers/__tests__/marketplace-dlq-consumer.test.ts: added, +163/-0apps/api/src/workers/marketplace-dlq-consumer.ts: added, +142/-0apps/api/src/workers/marketplace-events.ts: modified, +10/-128infra/marketplace.ts: modified, +37/-0Generated by Polylane. You can ask follow-ups by mentioning @polylane in a comment.