Replay `start()` can include old "history" events that are not relevant to the replay
When calling start(), we always include a breadcrumb for the initial page navigation. This should not always be included and will cause the replay to appear to start earlier than when the public start() function is actually caused.
To repro:
- set sample rates to 0 (we want manual recording)
- reload page (this will create the navigation.reload breadcrumb)
- wait
seconds - observe current time and then call replay.start()
- console.log something so that it gets record to replay
You'll see that we get a navigation breadcrumb at time = 0 and the console.log happens at time = x
I am not sure I understand this 🤔 what exactly is happening/should not be happening? We do not add a breadcrumb for start, I believe...? Or at least I do not know which breadcrumb this is refering to 😅
I think it's the handleHistorySpanListener -- basically what happens is that we call start() start.
I haven't verified this closely yet, but this seems like what is happening.
Released with https://github.com/getsentry/sentry-javascript/releases/tag/8.8.0