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

MSC3613: Combinatorial join rules #3613

Closed
wants to merge 5 commits into from

Conversation

turt2live
Copy link
Member

@turt2live turt2live commented Dec 31, 2021

Alternative titles:

  • Combined join rules
  • Simplified join rules
  • SYNERGISING JOIN AUTHORISATION FOR HARMONISED CROSS-DOMAIN ONBOARDING

Rendered
FCP proposal

This proposal is intended as a shorter term solution while other MSCs, like MSC3386, work out a potentially all-new system.

Proof of concept implementation: matrix-org/synapse#11668

Preview: https://pr3613--matrix-org-previews.netlify.app

@turt2live turt2live marked this pull request as ready for review December 31, 2021 04:13
@turt2live turt2live added client-server Client-Server API kind:maintenance MSC which clarifies/updates existing spec proposal A matrix spec change proposal proposal-in-review requires-room-version An idea which will require a bump in room version unassigned-room-version Remove this label when things get versioned. labels Dec 31, 2021
turt2live added a commit to matrix-org/synapse that referenced this pull request Dec 31, 2021
MSC: matrix-org/matrix-spec-proposals#3613

This is not a comprehensive implementation and was only built to prove that the idea works in a limited test case (knocking+restricted). 

The following still need to be considered/completed:
* [ ] Make code quality on par with the rest of the project
* [ ] Tests
* [ ] Use the utility function in all the places
* [ ] Update redaction algorithm
* [ ] Remove auth rule changes (see MSC)
* [ ] Fix handling of `allow` (see TODOs in code)
@turt2live
Copy link
Member Author

putting this up for SCT review as I think it's generally good to go for FCP, but feels a bit wrong to call FCP myself.

@Mikaela Mikaela mentioned this pull request Feb 3, 2022
2 tasks
@turt2live
Copy link
Member Author

in an effort to accelerate review that has not been received:

@mscbot fcp merge

@mscbot
Copy link
Collaborator

mscbot commented Feb 10, 2022

This FCP proposal has been cancelled by #3613 (comment).

Team member @mscbot has proposed to merge 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.

@mscbot mscbot added disposition-merge proposed-final-comment-period Currently awaiting signoff of a majority of team members in order to enter the final comment period. and removed proposal-in-review labels Feb 10, 2022
Copy link
Member

@uhoreg uhoreg left a comment

Choose a reason for hiding this comment

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

Looks fairly sane, but I'd prefer to see review from someone server-side before adding my ✔️


Note how the `join_rule` persists in the protocol, even with this MSC's introduction. This is to
ensure backwards compatibility with clients and various places in the protocol which aren't aware
of the new rules. While servers will be required to parse the event as described below, areas such
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 somewhat concerned that by including join_rule, it will confuse older clients into thinking that the join rule is something that it can modify, and so a room admin using an older client will try to change something and unintentionally lose information. Would it work to use a new value for join_rule, say, "join_rule": "combinatorial", so that clients know that it's something new, and they should be careful changing it? (I have no idea how clients deal with join_rules that they don't understand, but they've at least gone through it with restricted.)

Copy link
Member Author

Choose a reason for hiding this comment

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

A new join rule ends up breaking support for the room being in the room directory and such (and can have an impact on whether or not the room is visible in a space directory), so would generally try and steer away from that. This wouldn't really be an issue if knocking wasn't on the table, but unfortunately the exact case of knocking+restricted is what's at play.

Clients do generally handle new join rules reasonably well, but only because they tend to be not super smart about it. For setting join rules, clients seem to use a pattern where they set the entire event content each time, but this is hardly defensible as a pattern to rely upon (for the case where an older client tries to change the join rule and either does nothing or breaks the previous conditions).

To try and mitigate both, does string concatenation feel too awful? Specifically so that servers can joinRule.contains("knock") over federation on things like space hierarchies and to make it clear to clients that they need to fix something. Eg: join_rule: "knock+restricted"

than one rule active at a time, which makes it difficult to allow anyone from room X to join, but also
join if their knock was accepted. The room would instead have to choose which condition it favoured.

This proposal aims to introduce the smallest possible baseline for a slightly improved join rules
Copy link
Member

Choose a reason for hiding this comment

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

I see where you're trying to go here, but honestly I can't help but feel it's overcomplicating the situation.

Let's consider what combinations actually make sense. Currently we have the following permissible join_rules:

  • public
  • knock
  • invite
  • restricted
  • private

private is undefined, so we can forget about that. There's not much point combining public with anything else. invite doesn't do anything if you combine it with knock or restricted.

So the only combination we actually need to care about is knock and restricted. So why don't we just define a new join rule which does that? Granted it doesn't scale if we add more join rule types in future, but you seem to be phrasing this as a stop-gap while we sort out MSC3386 anyway.

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 hope was that we'd be able to fill the gap+some percentage, but yea: it's feeling more and more appropriate to just define restricted_knock or something.

Copy link
Member

@clokep clokep Feb 22, 2022

Choose a reason for hiding this comment

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

An alternative could be to add an allow_knock key to the restricted join rule that restricts who is allowed to knock. Pairing this with a new allow condition type might allow people in rooms X to join automatically and anyone to knock.

Copy link
Member

Choose a reason for hiding this comment

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

Yeah, I think I agree that introducing combining operations between join rules seems likely to be simple to express but hard to actually define all the edge cases of, and polyfilling the gap we have is probably better for a short-term solution.

@turt2live
Copy link
Member Author

The feedback on this causes the MSC to diverge quite a bit from its original intent, so going to write up an implementation and open a new MSC to cover the suggestions.

The original plan was to re-use this MSC number and move quickly enough to not have to cancel FCP, but empirically time is not something I have the luxury of speeding up ;)

In the meantime:
@mscbot fcp cancel

@mscbot mscbot removed the proposed-final-comment-period Currently awaiting signoff of a majority of team members in order to enter the final comment period. label Mar 7, 2022
@turt2live turt2live self-assigned this Mar 7, 2022
@turt2live turt2live added the blocked Something needs to be done before action can be taken on this PR/issue. label Mar 7, 2022
@Mikaela
Copy link
Contributor

Mikaela commented Mar 19, 2022

Has there been development on the new MSC, will it be linked here?

@turt2live
Copy link
Member Author

This MSC is rejected in favour of #3787

@turt2live turt2live closed this May 4, 2022
@turt2live turt2live added obsolete A proposal which has been overtaken by other proposals rejected A proposal which has been rejected for inclusion in the spec and removed proposal-in-review blocked Something needs to be done before action can be taken on this PR/issue. labels May 4, 2022
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:maintenance MSC which clarifies/updates existing spec obsolete A proposal which has been overtaken by other proposals 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 unassigned-room-version Remove this label when things get versioned.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants