index: persist and retry webhook deliveries - #380
Draft
shamsartem wants to merge 4 commits into
Draft
Conversation
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.
Summary
X-Index-Deliveryvalue across attempts so receivers can deduplicate ambiguous retriesFixes #336. The background queue and stable event identifier also address the retry/idempotency requests discussed in #305.
Delivery semantics
Delivery is at-least-once. A timeout after the receiver accepted a request can cause another attempt, so receivers should treat
X-Index-Deliveryas an idempotency key and return success for a duplicate. The normal recording operation completes after the payload is durably queued; webhook retries do not repeat transcription or agent work.This is built on the current per-gesture webhook model. #302 touches several of the same webhook files. #373 also introduces
X-Index-Deliveryas part of HMAC signing; if it lands first, this branch will need a small rebase so the stable queue ID is fed into its signing path.Tests
:experimental:testAndroidHostTest:experimental:compileAndroidDeviceTest:androidApp:assembleDebug(using the repository dummy Firebase config)The queue and transport code live in
commonMainfor Android and iOS. I could not build the Apple target on Linux.AI disclosure
This change was developed with AI assistance. I reviewed the complete diff, the queue state transitions, retry classification, database migration, payload cleanup, UI path, and documentation, and ran the tests and Android builds listed above.