Skip to content

Hold state store lock while while processing sync response in Client::sync_once#6555

Merged
poljar merged 1 commit into
matrix-org:mainfrom
mgoldenberg:hold-state-store-lock-during-sync
May 21, 2026
Merged

Hold state store lock while while processing sync response in Client::sync_once#6555
poljar merged 1 commit into
matrix-org:mainfrom
mgoldenberg:hold-state-store-lock-during-sync

Conversation

@mgoldenberg
Copy link
Copy Markdown
Contributor

@mgoldenberg mgoldenberg commented May 8, 2026

This pull request ensures that Client::sync_once holds the state store lock while processing a sync response. This amounts to acquiring the lock for the duration of BaseClient::receive_sync_response_with_requested_required_states, which is responsible for processing the response.

Note that this mimics the behavior of SlidingSync::sync_once.


Closes #6548.

  • I've documented the public API Changes in the appropriate CHANGELOG.md files.
  • This PR was made with the help of AI.

Signed-off-by: Michael Goldenberg m@mgoldenberg.net

@codecov
Copy link
Copy Markdown

codecov Bot commented May 8, 2026

Codecov Report

❌ Patch coverage is 75.00000% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 89.95%. Comparing base (8675cb2) to head (fb1d04c).
✅ All tests successful. No failed tests found.

Files with missing lines Patch % Lines
crates/matrix-sdk-base/src/client.rs 75.00% 0 Missing and 1 partial ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #6555      +/-   ##
==========================================
- Coverage   89.95%   89.95%   -0.01%     
==========================================
  Files         382      382              
  Lines      107959   107958       -1     
  Branches   107959   107958       -1     
==========================================
- Hits        97118    97109       -9     
- Misses       7172     7176       +4     
- Partials     3669     3673       +4     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@mgoldenberg mgoldenberg marked this pull request as ready for review May 8, 2026 12:30
@mgoldenberg mgoldenberg requested a review from a team as a code owner May 8, 2026 12:30
@mgoldenberg mgoldenberg requested review from poljar and removed request for a team May 8, 2026 12:30
@codspeed-hq
Copy link
Copy Markdown

codspeed-hq Bot commented May 8, 2026

Merging this PR will not alter performance

✅ 50 untouched benchmarks


Comparing mgoldenberg:hold-state-store-lock-during-sync (fb1d04c) with main (8675cb2)

Open in CodSpeed

@poljar poljar force-pushed the hold-state-store-lock-during-sync branch from 3a99fee to fb1d04c Compare May 21, 2026 10:18
@poljar poljar enabled auto-merge (rebase) May 21, 2026 10:19
Signed-off-by: Michael Goldenberg <m@mgoldenberg.net>
@poljar poljar merged commit b847983 into matrix-org:main May 21, 2026
53 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Client::sync_once should hold state store lock while processing a sync response

2 participants