Repository navigation
feat(notifications): track notification delivery receipts - #1861
Merged
github-actions[bot] merged 2 commits intoOct 26, 2026
Merged
Conversation
Adds delivery receipts (Smartdevs17#1749): a per-channel status timeline tracking what happened after a provider accepted a message. Backend - deliveryReceiptService: forward-only, idempotent status lifecycle (accepted/sent/delivered/failed/undelivered/expired) with an in-memory repository and per-user retention cap - deliveryReceiptTransport: ChannelTransport decorator that records one receipt per attempt and captures a provider message id when stashed by the transport; wired around the email and SMS transports in the container - deliveryStatusRouter: /api/delivery-receipts list/summary/single plus a Twilio-compatible status callback (form or JSON), with optional HTTP Basic auth via TWILIO_ACCOUNT_SID Frontend - deliveryReceiptsStore: read-through client cache over the API - DeliveryStatusScreen: per-channel summary + recent-attempt timelines - Settings entry point and navigation registration Docs: delivery-receipts section in docs/NOTIFICATIONS.md
# Conflicts: # backend/server.ts # backend/services/container.ts # docs/NOTIFICATIONS.md # src/navigation/modules/SettingsStack.tsx # src/navigation/types.ts
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
A notification record says a transport accepted a message. This adds delivery receipts (#1749): a per-channel status timeline of what happened afterwards — the carrier confirming the SMS landed, an email bounce, a push ticket that expired — so support can answer "did the customer actually get it?" without opening a provider dashboard.
Backend
deliveryReceiptService— forward-only, idempotent status lifecycle (accepted → sent → delivered, orfailed/undelivered/expired). Out-of-order provider callbacks cannot regress a receipt. In-memory repository plus a per-user retention cap mirroring history.deliveryReceiptTransport— aChannelTransportdecorator that records one receipt per attempt and captures a provider message id when the transport stashes it. Wrapped around the email and SMS transports inservices/container.ts, so a send that never reaches a transport leaves no receipt.deliveryStatusRouter(mounted at/api/delivery-receipts):GET /api/delivery-receipts?userId=…[&channel=…&limit=…]GET /api/delivery-receipts/summary?userId=…GET /api/delivery-receipts/:idPOST /api/delivery-receipts/status— Twilio-compatible callback (form or JSON); optional HTTP Basic auth viaTWILIO_ACCOUNT_SID; unknown ids ack with202so providers stop retrying.Frontend
deliveryReceiptsStore— read-through client cache over the API.DeliveryStatusScreen— per-channel latest status plus recent-attempt timelines.Docs
New "Delivery receipts" section in
docs/NOTIFICATIONS.md.Testing
deliveryReceiptService.test.ts+deliveryStatusRouter.test.ts— 46 tests, real HTTP server over the router (status lifecycle, out-of-order regression, summary, retention, callback parsing/auth, JSON + form bodies).deliveryReceiptsStore.test.ts— 7 tests (fetch, caching, error, reset).DeliveryStatusScreen.test.tsx— summary, timeline, empty, refresh, error states.npx jest -c jest.backend.config.js backend/services/notificationgreen for new suites; remaining failures identical to baseline.tscintroduces no new errors (516 total, same asmain).closes #1749