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

m.room.tombstone should reference the new room's create event #407

Open
turt2live opened this issue Jan 4, 2019 · 6 comments
Open

m.room.tombstone should reference the new room's create event #407

turt2live opened this issue Jan 4, 2019 · 6 comments
Labels
A-Client-Server Issues affecting the CS API enhancement A suggestion for a relatively simple improvement to the protocol

Comments

@turt2live
Copy link
Member

Background: MSC1501 adds room upgrade support, which is where m.room.tombstone comes from.

An event ID in the tombstone event makes it easier for clients to jump to the new room at the beginning of the timeline.

@turt2live turt2live added the enhancement A suggestion for a relatively simple improvement to the protocol label Jan 4, 2019
@richvdh
Copy link
Member

richvdh commented Jan 6, 2019

this leads to a bit of a chicken-and-egg situation. The create event currently points to the tombstone, so has to be created after the tombstone. For the tombstone to point to the create, it would have to be created after the create event.

I suppose we could create a second tombstone event once we know the event id of the create event, but it seems a bit inelegant.

Of course, I now can't remember why we decided that the create event needed to link to the tombstone anyway. Is that actually used anywhere? Perhaps we could swap them around.

@turt2live
Copy link
Member Author

It might be possible if the server reserves the event ID of either side before sending out the events. Something like:

  1. Generate a placeholder ID for the tombstone event
  2. Create the new room, referencing the placeholder ID
  3. Populate the tombstone event with the newly created room ID/event ID
  4. Send all the events to all the places

I think there's value in having both directions be strongly linked, although on retrospect having it be tombstone->new room feels more useful than the other way around.

@richvdh
Copy link
Member

richvdh commented Jan 7, 2019

in an imminent room version, event IDs will be based on the content of the event rather than generated in advance: matrix-org/matrix-spec-proposals#1640

@turt2live
Copy link
Member Author

Well that certainly makes things harder. I guess it's a question of which direction are people going to find the most value in, and doing that.

@KitsuneRal
Copy link
Member

As a client author I really don't have a problem with having just room ids; but I'm only dealing with clients that run a /sync loop.

Even without a sync loop, one can still use a one-off /sync call without a batch token to get bottommost events in a room - coincidentally that means up to the m.room.tombstone in case of upgraded rooms. Meanwhile the mechanism to jump to the beginning of a timeline is not really there (retrieve m.room.create and then call /context separately?) So I'd probably consider swapping the reference direction too.

@richvdh
Copy link
Member

richvdh commented Jan 8, 2019

kitsune's argument is convincing to me. Sounds like we should reverse the direction of the event id link.

@turt2live turt2live added the A-Client-Server Issues affecting the CS API label Feb 6, 2019
@richvdh richvdh transferred this issue from matrix-org/matrix-spec-proposals Mar 1, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-Client-Server Issues affecting the CS API enhancement A suggestion for a relatively simple improvement to the protocol
Projects
None yet
Development

No branches or pull requests

3 participants