-
Notifications
You must be signed in to change notification settings - Fork 379
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
MSC2190: Allow appservice bots to use /sync #2190
base: old_master
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||||||
---|---|---|---|---|---|---|---|---|
@@ -0,0 +1,42 @@ | ||||||||
# Allow appservice bots to use /sync | ||||||||
|
||||||||
In the past, application services could use `/sync` as the appservice bot as an | ||||||||
alternative to having a HTTP server listening for events from the homeserver. | ||||||||
At some point, that feature was deprecated and broke entirely, so appservice | ||||||||
bot `/sync`ing was blocked in synapse entirely (in [matrix-org/synapse#2948]). | ||||||||
Later the limitation was added to the spec in [matrix-org/matrix-doc#1144] and | ||||||||
[matrix-org/matrix-doc#1535]. | ||||||||
|
||||||||
Currently, the application service spec states | ||||||||
|
||||||||
> Application services wishing to use `/sync` or `/events` from the Client-Server | ||||||||
API MUST do so with a virtual user (provide a `user_id` via the query string). | ||||||||
It is expected that the application service use the transactions pushed to | ||||||||
it to handle events rather than syncing with the user implied by | ||||||||
`sender_localpart`. | ||||||||
|
||||||||
## Proposal | ||||||||
|
||||||||
The limitation is unnecessary, so this proposal suggests removing the special | ||||||||
casing. This would mean calling `/sync` with the appservice token and no | ||||||||
identity assertion parameter would work the same way as any other user calling | ||||||||
`/sync`, i.e. it only returns events for the appservice bot. Note that this | ||||||||
behavior would be different from the original synapse behavior, where `/sync` | ||||||||
returned events for all users in the appservice's namespace. | ||||||||
|
||||||||
## Tradeoffs | ||||||||
|
||||||||
None. | ||||||||
Comment on lines
+27
to
+29
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. the MSC template removed this section because it was pointless. Suggest doing the same here.
Suggested change
|
||||||||
|
||||||||
## Potential issues | ||||||||
|
||||||||
Old appservices that use `/sync` could run into silent issues rather than the | ||||||||
very clear internal server error currently thrown by synapse. | ||||||||
Comment on lines
+33
to
+34
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The real issue here is that people could write application services that do not scale (since Whether or not you consider that a real issue, it's unarguably a potential issue, so should be called out here. By omitting it, it suggests you're not even considering it. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. To expand on this: it could be considered regrettable that the |
||||||||
|
||||||||
## Security considerations | ||||||||
|
||||||||
None. | ||||||||
|
||||||||
[matrix-org/matrix-doc#1144]: https://github.com/matrix-org/matrix-doc/issues/1144 | ||||||||
[matrix-org/matrix-doc#1535]: https://github.com/matrix-org/matrix-doc/pull/1535 | ||||||||
[matrix-org/synapse#2948]: https://github.com/matrix-org/synapse/pull/2948 |
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.
We had another loop around this MSC among the spec core team today. I will try to summarise the discussion:
/sync
, particularly if MSC2409 can be fixed (which is rather more likely than it used to be thanks to Send some ephemeral events to appservices synapse#8437)./sync
, which I've started a different thread on (MSC2190: Allow appservice bots to use /sync #2190 (comment)).On the last point in particular:
On the other hand:
/sync
for appservices), but that basically means that Synapse wouldn't be spec-compliant out of the box and might lead to fragmentation.