Skip to content

feat: Dead-letter Queue#4

Draft
Chriztiaan wants to merge 1 commit into
feat/initfrom
feat/dead-letter-queue
Draft

feat: Dead-letter Queue#4
Chriztiaan wants to merge 1 commit into
feat/initfrom
feat/dead-letter-queue

Conversation

@Chriztiaan
Copy link
Copy Markdown
Collaborator

@Chriztiaan Chriztiaan commented May 25, 2026

Problem

When mutations are uploaded to the backend, non-transient/fatal errors in the flow can cause the upload pipeline to be stuck as it can't progress the uploaded queue. To avoid this, some of our demos call transaction.complete() on fatal errors to let the upload queue progress but in turn causing the mutation to be thrown out.

Solution

The PowerSync docs mention dead-letter queues as a mechanism for keeping these entries that would otherwise be lost. Fatal errors are caught on the server side and the mutation payload alongside debugging information is stored in a database allowing developers/admins to inspect the data and handle the entry however they need (replay, reshape, etc).

This PR introduces an example of how this could be implemented, alongside a hook that fires when a new dead-letter queue entry is added (typically users could use that to kick off a notification or even their reconciliation logic).

Outstanding

  • Avoiding schema versioning (which might be important for reconciliation logic when schema issues were the cause for the entry).

Diagram

Data flow
image

AI disclosure

This PR was created with the help of Claude Code. Help constitutes assistance in research, planning, and rough outline of implementation. Beyond having a hand in the implementation, I have also manually tested this work.

@Chriztiaan Chriztiaan changed the base branch from main to feat/init May 26, 2026 07:36
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