feat(receipt): expose the 'offline' attr on the Receipt event - #780
Conversation
WA Web parses 'offline' on incoming receipts (incomingMsgReceiptParser: offline = maybeAttrString) and retries; receipts drained from the server's offline queue on reconnect carry it. We never read it, so a consumer couldn't tell a live receipt from one replayed out of the offline queue (relevant for resume metrics and for not re-firing receipt-driven logic on stale acks). Parse the attr in handle_receipt and add Receipt.offline.
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository UI Review profile: ASSERTIVE Plan: Pro Plus Run ID: 📒 Files selected for processing (3)
📝 WalkthroughSummary by CodeRabbit
WalkthroughReceipt events now carry an ChangesReceipt offline attribute
🎯 2 (Simple) | ⏱️ ~8 minutes Possibly related PRs
Suggested labels
Look, the change is straightforward and necessary—you're propagating the offline attribute from the stanza through to the Receipt event, which is the right architectural choice. The parsing logic is clean, both emission paths are covered, and the test coverage validates the expected behavior. No surprises here. Make sure the offline semantics are documented clearly for users of this API so they understand the distinction between drained offline receipts and live ones. This is a public API change, so the breaking-change label is appropriate. 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Benchmark Results67 unchanged benchmark(s)
|
WA Web parses
offlineon incoming receipts (incomingMsgReceiptParser:offline = maybeAttrString("offline")) and on retries (retryRequestParser:hasAttr("offline")). Receipts/retries delivered while the server flushes its offline queue on reconnect carry this marker. We never read it andEvent::Receipthad no field for it, so a consumer couldn't distinguish a live receipt from one drained out of the offline queue — relevant for resume metrics and for not re-firing receipt-driven logic on stale acks.This parses the
offlineattribute inhandle_receiptand addsReceipt.offline(set on both the aggregated per-user and simple receipt paths). Added a test dispatching a receipt with and without the attr.Breaking for
Receiptstruct-literal constructors (pre-1.0); in-tree constructors (handle_receipt + the retry tests) are updated. Consumers that match onEvent::Receiptfields are unaffected.