Skip to content

[Replay Details] Improve useReplayData so that it returns attachments in-order #50891

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

Closed
ryan953 opened this issue Jun 13, 2023 · 0 comments · Fixed by #50901
Closed

[Replay Details] Improve useReplayData so that it returns attachments in-order #50891

ryan953 opened this issue Jun 13, 2023 · 0 comments · Fixed by #50901
Assignees

Comments

@ryan953
Copy link
Member

ryan953 commented Jun 13, 2023

Currently in useReplayData() we have a helper [fetchAttachments() https://github.com/getsentry/sentry/blob/272db4d46dad6370ac1b0d19a96f63cd7197f1f0/static/app/utils/replays/hooks/useReplayData.tsx#L125](https://github.com/getsentry/sentry/blob/272db4d46dad6370ac1b0d19a96f63cd7197f1f0/static/app/utils/replays/hooks/useReplayData.tsx#L125-L157)

This takes a list of generated cursors and, instead of paging through data, fetches everything in parallel. This is better for loading things quickly, but the data can arrive out of order. Therefore it will be concatenated into setAttachments() out of order too.

We should track order so that when we return the attachment list everything is returned in order.

If the data is returned in-order here, then we can remove extra sorting inside of ReplayReader. The RRWeb player component needs rrweb data returned in order, but we can trade cpu/memory during load with some more js code.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
1 participant