Reintroduce #19714 - Send a SSS response immediately if the config has changed#19792
Open
erikjohnston wants to merge 5 commits into
Open
Reintroduce #19714 - Send a SSS response immediately if the config has changed#19792erikjohnston wants to merge 5 commits into
erikjohnston wants to merge 5 commits into
Conversation
…re new results to sync (#19714) This fixes the bug described in #19713 (and double-checked against the SDK integration test, which now passes with this change). A sync response must be returned immediately if a room subscription configuration change caused a new non-empty response (checked with `if response` in the code) to be produced. Fixes #19713. Fixes #18844. --------- Co-authored-by: Erik Johnston <erik@matrix.org>
reivilibre
reviewed
May 20, 2026
| @@ -0,0 +1 @@ | |||
| Have SSS return a new response immediately if a room subscription have changed and produced a new response. | |||
Contributor
There was a problem hiding this comment.
This PR also adds a fix so that we don't always return immediately when using the e2ee extension.
I assume this fixes #18880 (add it to the PR description)
| @@ -0,0 +1 @@ | |||
| Have SSS return a new response immediately if a room subscription have changed and produced a new response. | |||
Comment on lines
304
to
+314
| # Note that "signed_curve25519" is always returned in key count responses | ||
| # regardless of whether we uploaded any keys for it. This is necessary until | ||
| # https://github.com/matrix-org/matrix-doc/issues/3298 is fixed. | ||
| # | ||
| # Also related: | ||
| # https://github.com/element-hq/element-android/issues/3725 and | ||
| # https://github.com/matrix-org/synapse/issues/10456 | ||
| default_otk = self.device_one_time_keys_count.get("signed_curve25519") | ||
| more_than_default_otk = len(self.device_one_time_keys_count) > 1 or ( | ||
| default_otk is not None and default_otk > 0 | ||
| ) | ||
| # | ||
| # This is why we don't incorporate `device_one_time_keys_count` | ||
| # (or `device_unused_fallback_key_types`) into the | ||
| # `__bool__` check. |
Contributor
There was a problem hiding this comment.
This seems more like a workaround than a fix. Ideally, we would immediately respond if these things changed. The risk is that the one-time keys could be exhausted without the users /sync waking up and knowing to add more. We should at-least add a FIXME here and justification for why we think it's fine.
| [], | ||
| ) | ||
|
|
||
| def test_wait_for_new_data_timeout_with_otks(self) -> None: |
Contributor
There was a problem hiding this comment.
Has this been sanity checked to fail on develop?
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.
Reintroduces #19714, after being reverted in #19784.
Fix #18844
Fix #19783
This PR also adds a fix so that we don't always return immediately when using the e2ee extension.