Skip to content

Reintroduce #19714 - Send a SSS response immediately if the config has changed#19792

Open
erikjohnston wants to merge 5 commits into
developfrom
erikj/sss_immediately
Open

Reintroduce #19714 - Send a SSS response immediately if the config has changed#19792
erikjohnston wants to merge 5 commits into
developfrom
erikj/sss_immediately

Conversation

@erikjohnston
Copy link
Copy Markdown
Member

@erikjohnston erikjohnston commented May 20, 2026

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.

bnjbvr and others added 4 commits May 20, 2026 13:54
…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>
Comment thread synapse/types/handlers/sliding_sync.py Outdated
Copy link
Copy Markdown
Contributor

@reivilibre reivilibre left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

Comment thread changelog.d/19792.bugfix
@@ -0,0 +1 @@
Have SSS return a new response immediately if a room subscription have changed and produced a new response.
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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)

Comment thread changelog.d/19792.bugfix
@@ -0,0 +1 @@
Have SSS return a new response immediately if a room subscription have changed and produced a new response.
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Might as well include the changes from #19734

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.
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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:
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Has this been sanity checked to fail on develop?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

4 participants