Skip to content

100% cpu on endless backfill loop when moving from grid back to single room #160

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
bwindels opened this issue Oct 16, 2020 · 2 comments · Fixed by #253
Closed

100% cpu on endless backfill loop when moving from grid back to single room #160

bwindels opened this issue Oct 16, 2020 · 2 comments · Fixed by #253
Labels
bug Something isn't working

Comments

@bwindels
Copy link
Contributor

bwindels commented Oct 16, 2020

Happened on (Webkit) Edge in PWA mode, closing the grid with a room selected.

loop is interrupted and cpu goes back to normal by switching room
loadtop-cpu-spin-edge-pwa.zip

@bwindels
Copy link
Contributor Author

bwindels commented Mar 2, 2021

I think this happens in rooms that don't have enough events to fill the viewport.

@bwindels
Copy link
Contributor Author

bwindels commented Mar 2, 2021

So, I have been able to reproduce this reliably. At least I think it is the same issue.

So this is a login on an account with only 2 rooms, each with less than 10 events in their timeline. Both rooms have a prev_batch in their room response even though there is nothing to paginate back to, but ok.
Now, when opening the timeline, it tries to paginate and does /messages?dir=b with this token. The HS returns me the same messages as in the initial sync (but reversed). So it basically did a forward fill, sort off.

Hydrogen detects that all events are overlapping and ends up linking the fragment with itself, setting previousId to 0, the same as its id. Now when trying to load more messages, it enters in an infinite loop.

I've captured the server behaviour in a HAR file.

pagination-edge.zip

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant