Skip to content

Conversation

@andybalaam
Copy link
Member

@andybalaam andybalaam commented Mar 25, 2022

@andybalaam andybalaam changed the title Restricting who can overwrite a state event MSC3757: Restricting who can overwrite a state event Mar 25, 2022
@turt2live turt2live added requires-room-version An idea which will require a bump in room version proposal-in-review proposal A matrix spec change proposal s2s Server-to-Server API (federation) client-server Client-Server API unassigned-room-version Remove this label when things get versioned. kind:core MSC which is critical to the protocol's success needs-implementation This MSC does not have a qualifying implementation for the SCT to review. The MSC cannot enter FCP. labels Mar 25, 2022
@gleachkr

This comment was marked as duplicate.

Copy link
Contributor

@ShadowJonathan ShadowJonathan left a comment

Choose a reason for hiding this comment

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

One nit, else this looks sound.

them - and they also are awkward for some client implementations to
manipulate.

## Proposal
Copy link
Member

Choose a reason for hiding this comment

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

My general concern is that we already have JSON available to us, so we should use that. String packing works in areas where we don't have as fine control (voip call candidates, for example), but for something like this we can and should afford fields.

Copy link
Member Author

Choose a reason for hiding this comment

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

Since the SCT came down on the side of this proposal vs MSC3760 I consider this resolved. Please unresolve if you disagree.

Copy link
Member

Choose a reason for hiding this comment

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

I'm not sure where the conversation about the SCT preferring this over MSC3760 happened, but I'm strongly against the current proposal. String packing is going to cause bugs, having separate fields seems better in every sense.

Hence my concern I've left about insufficient alternatives being explored.

Copy link
Contributor

Choose a reason for hiding this comment

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

I think there’s general agreement that string packing is not a great long-term idea. This is not only a topic in the context of this MSC but also in the context of MSC4143.

The reason it’s being considered is that it’s an pragmatic change — lightweight for SDK maintainers to adopt and gives already (amongst others) the nice feature of pragmatic name-spacing which is a powerful property.

In contrast a big-bang change is disruptive and complex. Probably leading to a situation where nobody currently has time to implement it.

Hence, I am proposing deliver value without disruption (=using string packing) over disruptive and complex

Copy link

Choose a reason for hiding this comment

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

Despite frequent appearances to the contrary, matrix is intended to be a production-quality protocol, not some finished-over-a-weekend demo. You don't do "pragmatic" hacks in such a project, especially not for a new feature. If the feature requires "complex and disruptive" changes, so be it - this PR has been sitting around for three and a half years now, it can wait a couple more until those changes are worked out.

Copy link
Member

Choose a reason for hiding this comment

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

Right now, I am minded that the problems with this proposal (fundamentally: it's a hack that we don't want to have to support in the long term) outweigh the advantages of landing it swiftly.

@jplatte jplatte mentioned this pull request Apr 4, 2022
@Xiretza
Copy link

Xiretza commented Sep 5, 2025

Is "attempts to pack structured data into a JSON string" not a valid concern in the opinion of the SCT?

@turt2live
Copy link
Member

Please use threads for conversation, as otherwise there's a 95% chance we'll never see it.

The string packing concern is tracked as alternatives not being sufficiently explored, per https://github.com/matrix-org/matrix-spec-proposals/pull/3757/files#r2192809774

Comment on lines +17 to +24
This is problematic if a user needs to publish multiple state
events of the same type in a room, but would like to set access control so
that only they can subsequently update the event. An example of this is if a
user wishes to participate in VoIP call as per [MatrixRTC (MSC4143)](
https://github.com/matrix-org/matrix-spec-proposals/blob/toger5/matrixRTC/proposals/4143-matrix-rtc.md#the-matrixrtc-room-state),
by sending a state event for each of their devices that is to participate in the call.
They will typically not want other users in the room to be able to overwrite those state events,
so there ought to be a mechanism to prevent other users from doing so.
Copy link
Member

@dkasak dkasak Sep 5, 2025

Choose a reason for hiding this comment

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

To be honest, it's not clear to me that MatrixRTC call events should be state events. Call state is very ephemeral information, while room state is generally meant for longer-lived state, like room configuration.

Areas where room state did end up being used for quicker evolving information are precisely those that showcase many problems with such an approach: the need to retain stricter ownership over a subset of state events; the need to allow less privileged users to send state events, which brings about state spam concerns; the large volume of events calling for a mechanism to delete state, which turns out to be an almost impossible feat. Not to mention that state events in today's Matrix are unencrypted. It all screams bad fit to me.

I realise this is coming a bit late to the party given when MatrixRTC implementations are already running in the wild. But given that this is used as the sole example of a requirement for this MSC and there is widespread dissatisfaction with string packing, I think it needs to be raised.

Copy link
Member

Choose a reason for hiding this comment

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

I second this. State events is the wrong place for this data, and by putting it in this wrong place we are creating a rod for our own back. String packing is, in the words of other people, a horrible hack. Does it work? Undeniably yes. Do we want to bake this into the protocol permanently? No. This is precisely the job of the SCT to block this kind of thing imo.

Now this does beg the question: what is the right place then? I've banged on internally that there isn't really a right place for this kind of data currently, and have been spending my downtime slowly crafting a proposal for an alternative. Effectively, all we want is:

  • Custom EDUs which can be sent by clients
  • persistent EDUs which guarantee delivery of the latest value sent on a per-room, per-user basis.

Thus sending a state event only you can modify becomes a persistent EDU (quite an oxymoron given the E stands for Ephemeral!) with whatever custom type/content you want.

The main driver for this MSC afaict is MatrixRTC so we can even drop the "custom" part for now and only have fixed known EDUs for now to reduce the scope and risk of the changes.

I'd be much happier to thumbs up a persistent EDU proposal than shoehorn in owned state events.

Copy link
Member

Choose a reason for hiding this comment

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

State events is the wrong place for this data

Agreed.

Apart from the ephemerality of the data, another thing that makes it different to room state is that there is never any real reason to do state resolution. We only ever care about the "current" state, and (unlike regular state) there is a single server that can and should be trusted to be authoritative.

Copy link
Member

Choose a reason for hiding this comment

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

I'd be much happier to thumbs up a persistent EDU proposal than shoehorn in owned state events.

#4354 is this.

Copy link
Contributor

@MadLittleMods MadLittleMods Oct 21, 2025

Choose a reason for hiding this comment

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

Related conversation in the Improving the security of the federation protocol Matrix Conference 2025 talk by @kegsay. Some general notes:

  • State is for when you need conflict resolution
    • For setting the m.room.name, there can only be one m.room.name so you need conflict resolution
    • We should factor out things that don't need to be in state. Stay in your lane traffic (CALM theorem) like profile information (and MatrixRTC) should not be in state because it doesn't need conflict resolution
  • Would be good to get guidelines in the spec for when to use state vs the newly proposed sticky events vs to-device messages and EDU's to prevent people from abusing them in the future.

@turt2live turt2live added the blocked Something needs to be done before action can be taken on this PR/issue. label Sep 10, 2025
@turt2live
Copy link
Member

This MSC is blocked on conversations around possibly using non-state-events for VoIP becoming resolved.

@turt2live
Copy link
Member

The SCT has determined that this MSC will not be accepted, and is (currently) favouring approaches like MSC4354 instead.

@mscbot fcp cancel
@mscbot fcp close

@mscbot
Copy link
Collaborator

mscbot commented Sep 24, 2025

Team member @turt2live has proposed to close this. The next step is review by the rest of the tagged people:

Once at least 75% of reviewers approve (and there are no outstanding concerns), this will enter its final comment period. If you spot a major issue that hasn't been raised at any point in this process, please speak up!

See this document for information about what commands tagged team members can give me.

@turt2live turt2live added proposed-final-comment-period Currently awaiting signoff of a majority of team members in order to enter the final comment period. and removed blocked Something needs to be done before action can be taken on this PR/issue. unresolved-concerns This proposal has at least one outstanding concern proposed-final-comment-period Currently awaiting signoff of a majority of team members in order to enter the final comment period. labels Sep 24, 2025
@turt2live turt2live moved this from Proposed-FCP at risk to Ready for FCP ticks in Spec Core Team Workflow Sep 24, 2025
@turt2live turt2live removed matrix-2.0 Required for Matrix 2.0 00-weekly-pings Tracking for weekly pings in the SCT office. 00 to make it first in the labels list. labels Sep 24, 2025
Although both [the spec](https://spec.matrix.org/unstable/appendices/#server-name)
and [RFC 1035 §2.3.1](https://www.rfc-editor.org/rfc/rfc1035#section-2.3.1)
forbid the presence of underscores in domain names,
there noneless exist resolvable domain names that contain underscores.
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
there noneless exist resolvable domain names that contain underscores.
there nonetheless exist resolvable domain names that contain underscores.

@mscbot
Copy link
Collaborator

mscbot commented Oct 21, 2025

🔔 This is now entering its final comment period, as per the review above. 🔔

@mscbot mscbot added final-comment-period This MSC has entered a final comment period in interest to approval, postpone, or delete in 5 days. and removed proposed-final-comment-period Currently awaiting signoff of a majority of team members in order to enter the final comment period. labels Oct 21, 2025
@turt2live turt2live moved this from Ready for FCP ticks to In FCP in Spec Core Team Workflow Oct 21, 2025
@mscbot
Copy link
Collaborator

mscbot commented Oct 26, 2025

The final comment period, with a disposition to close, as per the review above, is now complete.

@mscbot mscbot closed this Oct 26, 2025
@mscbot mscbot added finished-final-comment-period and removed disposition-close final-comment-period This MSC has entered a final comment period in interest to approval, postpone, or delete in 5 days. labels Oct 26, 2025
@turt2live turt2live added rejected A proposal which has been rejected for inclusion in the spec and removed finished-final-comment-period labels Oct 27, 2025
@turt2live turt2live moved this from In FCP to BLOCKED, requires spec writing in Spec Core Team Workflow Oct 27, 2025
@turt2live turt2live moved this from BLOCKED, requires spec writing to Merged in Spec Core Team Workflow Oct 27, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

client-server Client-Server API kind:core MSC which is critical to the protocol's success needs-implementation This MSC does not have a qualifying implementation for the SCT to review. The MSC cannot enter FCP. proposal A matrix spec change proposal rejected A proposal which has been rejected for inclusion in the spec requires-room-version An idea which will require a bump in room version s2s Server-to-Server API (federation) unassigned-room-version Remove this label when things get versioned. voip

Projects

Status: Merged

Development

Successfully merging this pull request may close these issues.