fix(ui): long-poll room list sync after initial request#6361
Open
TigerInYourDream wants to merge 2 commits intomatrix-org:mainfrom
Open
fix(ui): long-poll room list sync after initial request#6361TigerInYourDream wants to merge 2 commits intomatrix-org:mainfrom
TigerInYourDream wants to merge 2 commits intomatrix-org:mainfrom
Conversation
Author
Reproduction context
Observed symptomAfter the initial sync completed and the client was idle, the homeserver kept receiving a continuous stream of requests like: with the same |
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #6361 +/- ##
==========================================
+ Coverage 88.93% 89.77% +0.83%
==========================================
Files 357 357
Lines 99195 98818 -377
Branches 99195 98818 -377
==========================================
+ Hits 88221 88713 +492
+ Misses 6991 6620 -371
+ Partials 3983 3485 -498 ☔ View full report in Codecov by Sentry. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
After the initial room-list sync,
RoomListServicecontinues sendingtimeout=0requests becauseSettingUp,Recovering, andRunning(before fully loaded) all forced immediate responses. This creates a tight polling loop when idle — the server returns empty responses instantly, and the client re-sends the sameposright away.Fix
Only force
timeout=0forState::Init. All post-init states usePollTimeout::Default, letting the server long-poll when idle. If the server has pending changes, it can still respond immediately regardless of the timeout value.Test
Added a regression test verifying the second sync request carries
timeout=30000instead oftimeout=0.