Does the Sentry JavaScript SDK retain unsent events in memory after a flush timeout?
0 reputation · 19 Dec 2022, 05:08 UTC
When network requests fail, the Sentry JavaScript SDK buffers events in an in‑memory queue. Calling flush(timeout) returns a promise that resolves after the timeout even if some events remain unsent. The SDK documentation does not specify what happens to those remaining events—whether they are discarded, kept in memory indefinitely, or persisted to storage such as localStorage or IndexedDB. This ambiguity affects long‑running single‑page applications that may experience sustained outages.
What is the exact fate of unsent events after a flush timeout? Does the SDK provide any configuration to control retention or automatic retry? Are there version‑dependent differences in this behavior that developers should verify?