Skip to content
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

MSC2409: Proposal to send typing, presence and receipts to appservices #2409

Merged
merged 29 commits into from
Oct 28, 2024
Merged
Changes from 1 commit
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
96213b5
Initial proposal commit
Half-Shot Feb 15, 2019
c70ba2b
Add body of proposal
Half-Shot Feb 15, 2019
553837c
Merge branch 'hs/appservice-edus' of https://github.com/Half-Shot/mat…
Sorunome Jan 14, 2020
771cafe
rename file
Sorunome Jan 14, 2020
7912fda
finish up MSC
Sorunome Jan 14, 2020
9339848
address issues
Sorunome Sep 1, 2020
49f2087
change key names and add unstable prefix
Sorunome Oct 13, 2020
4a06e25
Merge branch 'master' into soru+hs/appservice-edus
turt2live May 18, 2021
fdee029
Clarifications; to-device handling
turt2live May 18, 2021
231084d
It's not exactly like sync
turt2live May 18, 2021
0c794bc
Move to-device messages
turt2live Nov 24, 2021
9d20145
Copy edu_type behaviour
turt2live Nov 24, 2021
91436e4
Add full transaction example
turt2live Nov 24, 2021
ce393b1
Add implementation notes for to-device cleanup
turt2live Nov 24, 2021
c21f86a
Use type instead of edu_type to match realities of implementations
Half-Shot Oct 20, 2023
15f4582
Add note to say ephemeral can be omitted.
Half-Shot Nov 15, 2023
d1783c4
Improve wording on why we use a seperate array.
Half-Shot Nov 15, 2023
f4b1ec8
push_ephemeral -> receive_ephemeral
tulir Sep 28, 2024
3a8fc4d
Fix some typos and clarify EDU room association
tulir Sep 28, 2024
18abe04
Clarify EDU formatting
tulir Sep 28, 2024
5989fc8
Explicitly list all event types
tulir Sep 28, 2024
d7fb52a
Delete to-device events
tulir Sep 28, 2024
7057ba0
Update spec link and fix typo
tulir Sep 30, 2024
20501b4
Add private read receipt rules
tulir Sep 30, 2024
5a745fd
Apply suggestions from code review
tulir Oct 1, 2024
fa4d518
Wrap lines
tulir Oct 1, 2024
5431045
Apply suggestions from code review
tulir Oct 1, 2024
842c44e
Explicitly mention to-device events are not here
tulir Oct 1, 2024
94e605e
Mention the possibility of more granular filtering
tulir Oct 18, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Add implementation notes for to-device cleanup
  • Loading branch information
turt2live committed Nov 24, 2021
commit ce393b1b3dffa0cf7a0fdcc6250474873e9212f2
23 changes: 23 additions & 0 deletions proposals/2409-appservice-edus.md
tulir marked this conversation as resolved.
Show resolved Hide resolved
Original file line number Diff line number Diff line change
Expand Up @@ -193,6 +193,27 @@ shares a room with (or is under the appservice's namespace) would be sent to the
To-device messages for devices belonging to the appservice's user namespaces should always
be sent.

### Implementation detail: when to delete a to-device message

Not defined by this MSC is an explicit algorithm for when to delete a to-device message (mark
it as sent). This is left as an implementation detail, though a suggested approach is as
follows:

* If the message is sent to a user under an appservice's *exclusive* namespace, mark it as sent
and delete it. Note that retried transactions will still need to include the message.
* If the message is sent to a user under an appservice's *inclusive* namespace, mark it as sent
to the appservice but do not delete it until a `/sync` request is completed which includes the
message. Note that retried transactions will still need to include the message.
tulir marked this conversation as resolved.
Show resolved Hide resolved

This approach is largely to align with how namespaces are used by appservices in practice, but
is not applicable to all scenarios (and thus is an implementation detail). The majority of known
appservices use exclusive namespaces, which typically also means that those users will not be
calling `/sync`. Because of this, the server may never get another opportunity to delete the
messages until it has confirmed that the appservice received the transaction successfully. Inclusive
namespaces are typically used when the appservice wants to impact a subset of users, but without
controlling those users explicitly. Typically, inclusive users are also calling `/sync` and so
the appservice should be CC'd on the to-device messages that would normally go down `/sync`.

## Potential issues

Determining which EDUs to transmit to the appservice could lead to quite some overhead on the
Expand All @@ -209,4 +230,6 @@ that EDU.

In the transaction body, instead of `ephemeral`, `de.sorunome.msc2409.ephemeral` is used.

In the transaction body, instead of `to_device`, `de.sorunome.msc2409.to_device` is used.

In the registration file, instead of `push_ephemeral`, `de.sorunome.msc2409.push_ephemeral` is used.