Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Session Replay batching/queueing should be resilient to page reload #1099

Open
pauldambra opened this issue Mar 28, 2024 · 2 comments
Open

Comments

@pauldambra
Copy link
Member

We batch replay data in memory. This is normally fine but does mean that someone could miss collecting some data

This is made worse with minimum duration set - you have to stay on page for the minimum duration or you lose data

It also means we couldn't reliably do some features like capture locally until a manual trigger

Let's move the batch/queue to being in a persistent store in the brower

@marandaneto
Copy link
Member

We already listen to visibilitychange
https://developer.mozilla.org/en-US/docs/Web/API/Document/visibilitychange_event
We can force a store in the cache or force sending the pending data if the visibility is going to the background, reloading, or whatever makes sense to not lose data.
Another thing to do is if the network request actually fails due to eg no internet, slow internet, should we retry?

@pauldambra
Copy link
Member Author

so the existing implementation is memory backed and does retry failed sends / stops sending when network is gone etc
but sending on page leave is very flaky so we are always going to lose things

tbh I can probably pump the android code into chat gpt and ask it to switch to typescript and store in local storage instead of a file 🤣

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants