Skip to content

index: persist and retry webhook deliveries - #380

Draft
shamsartem wants to merge 4 commits into
coredevices:masterfrom
shamsartem:feature/index-webhook-delivery-queue
Draft

index: persist and retry webhook deliveries#380
shamsartem wants to merge 4 commits into
coredevices:masterfrom
shamsartem:feature/index-webhook-delivery-queue

Conversation

@shamsartem

Copy link
Copy Markdown

Summary

  • persist each webhook request in a dedicated Room queue before network delivery
  • retry transport failures and HTTP 408, 425, 429, and 5xx responses; resume pending deliveries when the app restarts
  • expose manual Retry for permanent HTTP failures without re-running transcription or the agent
  • send a stable X-Index-Delivery value across attempts so receivers can deduplicate ambiguous retries
  • clear audio, transcription, URL, and headers from successful queue rows while retaining the delivery-ID tombstone

Fixes #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-Delivery as 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-Delivery as 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 commonMain for 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.

@CLAassistant

CLAassistant commented Aug 25, 2026

Copy link
Copy Markdown

CLA assistant check
All committers have signed the CLA.

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.

Index webhook: INDEX_WEBHOOK_API.md documents a retry I can't find in the code

2 participants