-
Notifications
You must be signed in to change notification settings - Fork 258
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
feat(sdk): Sliding sync has a timeout if all lists require a timeout #3853
Conversation
This patch renames tests.
This patch implements and tests `SlidingSyncListLoadingState::is_fully_loaded` for more convenience.
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #3853 +/- ##
=======================================
Coverage 84.09% 84.10%
=======================================
Files 262 262
Lines 27646 27657 +11
=======================================
+ Hits 23249 23261 +12
+ Misses 4397 4396 -1 ☔ View full report in Codecov by Sentry. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd have wished the last 3 commits would be squashed into 59324a6, since they all update the logic introduced in that commit, and having them as separate commits makes the review somewhat harder. LGTM otherwise, assuming my comments will be addressed.
This patch adds a small helper: `SlidingSyncListRequestGenerator::is_selective`.
This patchs adds the `SlidingSyncList::requires_timeout` method to know exactly when a list should trigger a `timeout` on the request.
6f4e062
to
ddc8957
Compare
This patch updates when sliding sync requests have a `timeout`. Prior to this patch, all requests had a `timeout` query, set to the `poll_timeout` duration value. However it means: if there is no data to return, wait `timeout` milliseconds for new data before returning. This definition is correct. Problem: if the current range of a list has no data, the server will wait! It means that, in a situation where there is no update at all, but the client is fetching all rooms batch by batch, it will wait `poll_timeout` for each batch! The behaviour described above is absolutely correct. Some server implementations are less strict though, and we didn't realise our code was doing that, because the server had some optimisations to ignore the timeout if the range wasn't covering all the rooms. Nonetheless, a new server implementation (namely Synapse) is strict, and it confirms we have a bug here. This patch then configures a `timeout` if all lists require a timeout, otherwise there is no `timeout`, which is equivalent to `timeout=0`.
This patch is a small cleanup.
ddc8957
to
a84c172
Compare
This patch updates when sliding sync requests have a
timeout
.Prior to this patch, all requests had a
timeout
query, set to thepoll_timeout
duration value. However it means: if there is no datato return, wait
timeout
milliseconds for new data before returning.This definition is correct. Problem: if the current range of a list
has no data, the server will wait! It means that, in a situation where
there is no update at all, but the client is fetching all rooms batch by
batch, it will wait
poll_timeout
for each batch!The behaviour described above is absolutely correct. Some server
implementations are less strict though, and we didn't realise our code
was doing that, because the server had some optimisations to ignore the
timeout if the range wasn't covering all the rooms. Nonetheless, a new
server implementation (namely Synapse) is strict, and it confirms we
have a bug here.
This patch then configures a
timeout
if all lists require atimeout
,otherwise there is no
timeout
, which is equivalent totimeout=0
.