Overview
When multiple parts of the app call sdk.getInvoice(id) simultaneously for the same invoice, each triggers a separate RPC call. Add request deduplication so identical in-flight requests share a single network call.
Acceptance Criteria
- Concurrent calls with identical method + args share one in-flight request (promise deduplication)
- Deduplication window: the lifetime of the in-flight request — not a time window
- Second caller receives the same resolved/rejected value as the first
- Cache and deduplication are independent: deduplication applies even when cache is disabled
sdk.getDedupStats() returns { deduped: number, total: number } for observability
- Deduplication opt-out per call:
sdk.getInvoice(id, { dedupe: false }) for cases where fresh data is critical
- Works correctly with the retry layer — a retried request starts a new dedup window
Overview
When multiple parts of the app call
sdk.getInvoice(id)simultaneously for the same invoice, each triggers a separate RPC call. Add request deduplication so identical in-flight requests share a single network call.Acceptance Criteria
sdk.getDedupStats()returns{ deduped: number, total: number }for observabilitysdk.getInvoice(id, { dedupe: false })for cases where fresh data is critical