Description
Problem Statement
My understanding is that Replay relies on the first envelope being received first.
makeBrowserOfflineTransport
returns {}
when sending of an envelope fails and it's queued which Replay interprets as a successful send:
sentry-javascript/packages/core/src/transports/offline.ts
Lines 135 to 141 in ad9d6ab
Queued envelopes are re-tried after the next successful send and the order they enter the queue is preserved for re-sending.
However, the issue is that if the first envelope fails and is queued, and then the device comes back online, the second envelope will be sent before the first. This means that with an intermittent connection, envelope order is not always preserved.
Currently queuing of replay envelopes is disabled:
sentry-javascript/packages/core/src/transports/offline.ts
Lines 64 to 70 in ad9d6ab
Solution Brainstorm
This only impacts if there is no connection (or a failure) for only the very first envelope. Not sure of the best solution here. Maybe signal to Replay that the event has been queued?