Skip to content

Specify history sharing#2399

Open
richvdh wants to merge 14 commits into
mainfrom
rav/history_sharing
Open

Specify history sharing#2399
richvdh wants to merge 14 commits into
mainfrom
rav/history_sharing

Conversation

@richvdh

@richvdh richvdh commented Jun 15, 2026

Copy link
Copy Markdown
Member

Spec for MSC4268.

Based on #2398.

Pull Request Checklist

Preview: https://pr2399--matrix-spec-previews.netlify.app

richvdh and others added 7 commits June 12, 2026 15:42
@richvdh richvdh requested a review from a team as a code owner June 15, 2026 14:45
Comment thread content/client-server-api/modules/end_to_end_encryption.md Outdated
Comment thread content/client-server-api/modules/end_to_end_encryption.md
Comment thread content/client-server-api/modules/end_to_end_encryption.md Outdated
Comment on lines +1620 to +1621
1. Alice SHOULD ensure that she has downloaded all keys relevant to the room
from [server-side key backup](#server-side-key-backups), if she is using it.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I'm wondering if we should rephrase this section so that the requirements and actions are worded with respect to Alice's client rather than herself? The section below about Bob does it this way and it feels a little cleaner to me, if a bit more wordy.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

yup, agreed.

may be shared with future room members in this way.

Recipients SHOULD keep a record of the `shared_history` flag for each
encryption session. The state of the flag is also saved in the

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Likely a stupid question but why do we RECOMMEND keeping a local record here?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Not a stupid question.

I dunno really. I try to reserve MUST for circumstances where the protocol's going to stop working if implementations don't do it, as opposed to where the user's going to get a poor experience (if you want to make a client that gives your user a crappy experience, that's on you). It gets more complicated when we're talking about giving other users a poor experience, as in this case, but still I don't feel like it crosses the line into needing a MUST. Hard to justify objectively though.

Comment thread content/client-server-api/modules/end_to_end_encryption.md Outdated
received a copy of the decryption keys for the session, is seen to leave the
room.

{{% changed-in v="1.19" %}} Since any user that received an invite to the

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Should this not also list the new requirement to rotate the session when history visibility changes?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

good spot.

Comment on lines +1624 to +1627
containing the sessions she is aware of in the room. Alice SHOULD include
only [shareable encryption sessions](#shareable-encryption-sessions) in the
`room_keys` section of the structure; other sessions should be listed un the
with `withheld` section.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I probably missed it when scanning the MSC but I was surprised that this is a SHOULD. Does that not undermine the shared_history setting and allow for sharing keys that should be deemed unshareable?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

yup, good point. Let's change this.

richvdh and others added 2 commits June 17, 2026 18:33
Co-authored-by: Johannes Marbach <n0-0ne+github@mailbox.org>

@richvdh richvdh left a comment

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

@Johennes thanks for the review; I think I have addressed all your comments.

Comment thread content/client-server-api/modules/end_to_end_encryption.md
may be shared with future room members in this way.

Recipients SHOULD keep a record of the `shared_history` flag for each
encryption session. The state of the flag is also saved in the

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Not a stupid question.

I dunno really. I try to reserve MUST for circumstances where the protocol's going to stop working if implementations don't do it, as opposed to where the user's going to get a poor experience (if you want to make a client that gives your user a crappy experience, that's on you). It gets more complicated when we're talking about giving other users a poor experience, as in this case, but still I don't feel like it crosses the line into needing a MUST. Hard to justify objectively though.

Comment on lines +1620 to +1621
1. Alice SHOULD ensure that she has downloaded all keys relevant to the room
from [server-side key backup](#server-side-key-backups), if she is using it.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

yup, agreed.

Comment on lines +1624 to +1627
containing the sessions she is aware of in the room. Alice SHOULD include
only [shareable encryption sessions](#shareable-encryption-sessions) in the
`room_keys` section of the structure; other sessions should be listed un the
with `withheld` section.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

yup, good point. Let's change this.

received a copy of the decryption keys for the session, is seen to leave the
room.

{{% changed-in v="1.19" %}} Since any user that received an invite to the

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

good spot.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

release-blocker Blocks the next release from happening

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants