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.
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
Add Sliding Sync
/sync/e2ee
endpoint for To-Device messages #17167Add Sliding Sync
/sync/e2ee
endpoint for To-Device messages #17167Changes from 17 commits
f9e6e53
1e05a05
5e925f6
69f9143
d4ff933
371ec57
06d12e5
b8b70ba
c60a4f8
10ffae6
6bf4896
8871dac
0892283
adb7e20
f098355
6b7cfd7
b9e5379
9bdfa16
7331401
b23abca
821a1b3
35ca937
4ad7a8b
3092ab5
3539abe
5f194f9
02cecfa
f6122ff
2f112e7
c2221bb
717b160
514aba5
9749795
06ac1da
3da6bc1
d4b41aa
6606ac1
ab0b844
a482545
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
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.
Thinking more on that "relieving pressure on the Sliding Sync proxy now" point. Since the proxy is just another Matrix client which uses the
/sync
v2 loop, I don't think this new/sync/e2ee
endpoint will help anything because:(
/sync
v2 will acknowledge all of the To-Device events we're trying to serve with this new endpoint)Am I missing something?
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 think I wasn't taking into account that the proxy will be its own device that can be separate from device we can use for this endpoint. So acknowledging the To-Device messages for one device doesn't affect the other.
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.
Discussed this point in a meeting with @erikjohnston today and I think this might be a problem since it will be one device consuming everything. Would probably require updates to the Sliding Sync proxy to utilize both properly.
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 would have thought you'd either have a device using the proxy entirely or you have a device using Synapse's SS impl entirely, not a weird mixture of both. If so, this is not a problem afaict?
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.
The idea of this endpoint isn't to remove pressure from the proxy directly.
By having a new endpoint, the Matrix Rust SDK can consume it directly instead of using sliding sync proxy with a particular
conn_id
for Sliding Sync.That's the same idea with the improved
/context
, it removes the need for another use of sliding sync with anotherconn_id
.Finally, the last usage of sliding sync is the room list API. Since there will be only one usage of sliding sync, the
conn_id
won't be necessary anymore. In the simplified sliding sync implementation inside synapse, it means you would not have to manage multiple connection contexts at the same time.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.
This isn't true though, because the proxy will consume to-device messages that would have been delivered via
/sync/e2ee
, hence why it has to be an all-or-nothing for E2EE data. For/context
then absolutely, that can be done via synapse only.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.
Hmm indeed. So the migration should ideally be all-on-synapse, instead of half-proxy, half-synapse. Gotcha.
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.
You could probably use a whole another device for all e2ee operations, but it's quite ugly and a workaround.
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.
A lot of this is just sharing and summarizing the clarifications from @erikjohnston 🙇
Discussed this point a bit further and got a little more clarification. The main aim of
/sync/e2ee
and/context
[2] changes is to make handling notifications easier for the clients. Being able to use/sync/e2ee
alongside the Sliding Sync proxy to relieve pressure was just an extra thought but given that the proxy and client share the same device [1], will not work (see To-Device problem explained above). If usage of/sync
v2 and/sync/e2ee
usage is split between separate devices (as @MatMaul mentioned) it would work but I don't think people have bandwidth/desire/benefit to do it.This means that this endpoint probably won't be useful until we have a Sliding Sync implementation in Synapse itself. I started working on
/sync/e2ee
because I thought it would have some "sliding" aspect to ease my way into the concept but turns out to be just some/sync
v2 refactoring. It's still good in terms of getting familiar with/sync
v2 though.It may very well turn out that
/sync/e2ee
is not actually as helpful as we thought (or ifdevice_lists
is sufficiently heavyweight that its just as slow), but from @erikjohnston's understanding right now, it'd be quite helpful to the SDK team (I don't know the exact details here).[1] Sliding sync proxy shares the same device as the ElementX client (as far as it has been explained to me). The way it works is that EX calls the SS proxy with that token, and then the SS proxy caches it to make the requests.
[2] For onlookers, the
/context
changes just entail making the endpoint work for all events like invites. I haven't looked into what's necessary but it may be as simple as adjusting the check for whether someone is joined to the room.