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

MSC2199: Canonical DMs #2199

Open
wants to merge 39 commits into
base: old_master
Choose a base branch
from
Open
Changes from 1 commit
Commits
Show all changes
39 commits
Select commit Hold shift + click to select a range
b215c24
Over-the-top MSC for immutable DMs
turt2live Jul 24, 2019
912cee2
Softer MSC
turt2live Jul 24, 2019
a9255a5
Minor touchups
turt2live Jul 28, 2019
05b9115
What if we made it the server's problem
turt2live Jul 30, 2019
fd6e09b
Assign number
turt2live Jul 30, 2019
5fefd46
Clarify what the DM behaviour is early in the proposal
turt2live Jul 30, 2019
fec96ca
Maybe these platforms don't support single DMs?
turt2live Jul 30, 2019
d3e3cc3
Spelling
turt2live Jul 30, 2019
39f534d
Backlink to soft-tombstones
turt2live Jul 30, 2019
ab7a963
Clarify who the user ID is in sugar APIs
turt2live Jul 30, 2019
de8b363
More spelling
turt2live Jul 30, 2019
5ca0946
Mention audit bots
turt2live Jul 30, 2019
82c8984
Fix words
turt2live Jul 31, 2019
9a7bf8b
Describe third party invites
turt2live Aug 1, 2019
7ad3b05
Counting is hard
turt2live Aug 6, 2019
69ea33d
Encourage re-use of DMs
turt2live Aug 6, 2019
369961c
Make some minor clarifications
turt2live Aug 6, 2019
21e0e85
Add prose to allow servers to not migrate DMs for new users
turt2live Aug 6, 2019
3400367
Missed a thing on leaving users
turt2live Aug 6, 2019
75f98a2
Remove uncertain platforms from list
turt2live Aug 17, 2019
fbf12ea
Skeptical clients are skeptical
turt2live Aug 17, 2019
5e4e55b
Clarify soft tombstone
turt2live Aug 17, 2019
f13a9fc
Better wording for the server behaviour cases
turt2live Aug 17, 2019
1fce23a
Mention MSC1777 for updating left rooms
turt2live Aug 17, 2019
8a2b316
Support private chats
turt2live Aug 17, 2019
21eb08d
Shuffle descriptions of power levels for members in preset
turt2live Aug 17, 2019
90e35de
Spacing
turt2live Aug 17, 2019
498705f
Clarify that we're not altering previous room version rules
turt2live Aug 17, 2019
901f9c3
Clarify that history is supposed to be protected
turt2live Aug 17, 2019
3545a35
More words about why enabling encryption is safe enough
turt2live Aug 17, 2019
dd292bd
Remove confusing banquets section
turt2live Aug 27, 2019
0cbd1dc
Inline the example image
turt2live Aug 27, 2019
d504efa
Use "dm" as the keyword
turt2live Aug 27, 2019
79ba509
Explain pitfalls of the current system
turt2live Aug 27, 2019
55f1c07
We're calling them canonical DMs
turt2live Aug 28, 2019
17108f5
Support a dedicate /createDm endpoint for DMs
turt2live Aug 28, 2019
553caf1
createDm -> create_dm
turt2live Aug 28, 2019
54dbbbd
Update proposals/2199-canonical-dms.md
turt2live Sep 11, 2019
8ab1af3
Update proposals/2199-canonical-dms.md
turt2live Oct 8, 2019
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
Better wording for the server behaviour cases
  • Loading branch information
turt2live committed Aug 17, 2019
commit f13a9fcba0c5f48627a7c0844c872c053947a10e
39 changes: 23 additions & 16 deletions proposals/2199-immutable-dms.md
Original file line number Diff line number Diff line change
Expand Up @@ -178,27 +178,34 @@ be sent as tombstoned. This proposal goes into more detail on this a bit later.
Unless an important user is banned, the DM is still considered alive and should be able to
Copy link
Member

Choose a reason for hiding this comment

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

surely a single important user being banned should not kill the DM as long as there are at least two other unbanned important users?

Copy link
Member Author

Choose a reason for hiding this comment

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

The complexity skyrockets when we don't kill it:

  • User A has a DM with User B
  • User A, B, and C all have a DM with each other.
  • User C is banned from the common DM.
  • This would now leave User A with two DMs with User B, which means the room needs to be resolved to a single room (tombstone).
  • User C becomes unbanned.
  • User C is potentially redirected to a private chat they cannot join, starting a new DM.
  • History between the rooms is lost.

So instead if we just kill it:

  • User A has a DM with User B
  • User A, B, and C all have a DM with each other.
  • User C is banned from the common DM.
  • The common room is considered dead. User A and B need to do nothing with their existing DM.
  • User C is unbanned, bringing the room back to life.

be rejoined even if some important people were to leave. However, there's a good chance that
when all important users leave that the room becomes unjoinable and therefore dead. To help
combat this, servers should approach rooms where important users have left with caution.
combat this, servers should approach rooms where important users have left with caution by
assuming the room cannot be brought back to life.

The following cases are reinforcement reading for the conditions mentioned so far. They
describe how the server is expected to behave given a common scenario - not all scenarios
are covered here.

**Case 1: The DM resides on a single homeserver**: when all important users leave the DM,
the DM should be considered soft-tombstoned for those users. This will cause a new DM to be
created. The presences of unimportant users can be enough for a homeserver to consider the
the DM is to be considered soft-tombstoned for those users. This will cause a new DM to be
created. The presence of unimportant users can be enough for a homeserver to consider the
room not dead and therefore rejoinable.

**Case 2: The DM resides on 2+ homeservers**: this gets a bit tricky. When the last important
user leaves, that homeserver might be inclined to consider it soft-tombstoned. However, this
is unlikely in practice: another server could rejoin thanks to unimportant users and invite
the last homeserver back. Both homeservers would converge on the room being the active DM for
those two users.

**Case 3: A duplicate DM comes in for a room the server has left**: the server would normally
be inclined to automatically tombstone the new DM in reference of the existing DM (which the
server has left). It must not do this unless it is a resident of the room and can verify
that the room is alive as otherwise its perspective of the room may be antiquated. Instead,
the server must assume that the new DM means that the existing one is dead for one reason
or another. If another server were to tombstone the new room and point to the existing room,
the user could then try and join the existing room and the server's perspective of the state
would be refreshed.
user leaves, that homeserver would not have visibility on the room anymore but does not have
enough information for it to be tombstoned (soft or otherwise). Another server can still rejoin
the room due to unimportant users being left behind, or keep the room alive without the other
homeserver continuing participation. The homeservers involved will still converge on the room
when other conversations start.

**Case 3: A duplicate DM comes in for a room the server has left**: when the server does not
have visibility on the members of a room anymore it cannot tombstone newly created rooms and
point to the room it can't see. If the server happens to be a resident of the room, it can
absolutely tombstone the new room in favour of the old room, even if the server's membership
is just unimportant users and the important users having left. When the server does encounter
an invite for a DM which duplicates a room it has left, it must assume that its perspective
of the older room is antiquated and that something happened to cause a new invite to come
in. After joining, if a server happened to tombstone the room to point to the older room
then the user could then try and join the room and refresh the server's perspective.

*Note*: Originally case 3 had a step for the server to autojoin the user into the existing
room to refresh its state, however this left a glaring hole for abuse to filter its way down
Expand Down