ProtoXEP: MUC2 Addressing/Occupancy (only)#1539
Conversation
| <section3 topic="XEP-0045 Compatibility"> | ||
| <p>If compatibility with MUC1 is required, note the following:</p> | ||
| <p>A client joining via MUC1's presence-based joins will not see these occupant-id based addresses, but instead sees the nickname-based addressing. This implies that MUC1 and MUC2 clients will see different addresses for the same occupant simultaneously.</p> | ||
| <p>Servers SHOULD use the same occupant-id for both MUC1 and MUC2. That is, it is RECOMMENDED that the resource string of a MUC2 occupant precisely match the occupant-id given by &xep0421; - it is expected that &xep0421; will be supported for MUC1 sessions, and if so it MUST be advertised</p> |
There was a problem hiding this comment.
While I appreciate flexibility in specs when possible, I would suggest making this a 'MUST'. The reason is that we have a bunch of extensions which build upon occupant-id, and if the same occupant has different ids depending on which protocol is used, things won't line up.
| <p>If compatibility with MUC1 is required, note the following:</p> | ||
| <p>A client joining via MUC1's presence-based joins will not see these occupant-id based addresses, but instead sees the nickname-based addressing. This implies that MUC1 and MUC2 clients will see different addresses for the same occupant simultaneously.</p> | ||
| <p>Servers SHOULD use the same occupant-id for both MUC1 and MUC2. That is, it is RECOMMENDED that the resource string of a MUC2 occupant precisely match the occupant-id given by &xep0421; - it is expected that &xep0421; will be supported for MUC1 sessions, and if so it MUST be advertised</p> | ||
| <p>In addition, MUC1 nicknames MUST NOT be allowed to clash with occupant-ids, and as such, servers SHOULD prefix the occupant-id used in the resource with some prefix, such as "-", to enforce this. This prefix is then rejected as (part of) a nickname.</p> |
There was a problem hiding this comment.
I encountered this issue in my work on a GC3 prototype. This solution is a bit hacky, but I can't think of anything better.
I think the precise translation should be specified in the XEP though, so that clients can map from occupant-id to room JID in all contexts.
There was a problem hiding this comment.
You could do it by rejecting any nickname that is (for example) a 40-character long string consisting only of hex characters, too, but that's going to be a weird UX.
In any case, I accept your point entirely; if we always prefix by a known character, and strip it, it obviates your other comment rather neatly too I think - we can just mandate the resource string be ("-" + occupant_id) and mandate that the occupant-id is the same XEP-0421 occupant-id in classic '45.
There was a problem hiding this comment.
Can't you reject any nick that is an occupant id? Or I guess the fear is that a future join could suddenly overlap with a previous nick? However in that case one could kick the nick-based session at that time?
| </section2> | ||
| <section2 topic="Bare JID occupancy sessions"> | ||
| <p>In order to handle the offline case, an iq-based joining protocol is also included. Clients joining the room in this way essentially request to be visible as an occupant (subject to the room's configuration), and also to receive messages to their bare JIDs. Groupchat messages sent to bare JIDs do not get sent to clients, and, in an unextended server, are bounced with a <service-unavailable/> error. Therefore clients MUST first establish if their server has MUC2-PAM support; if it does not, they MUST avoid this mechanism and use presence-based joins instead.</p> | ||
| <p>MUC2 rooms MUST send all messages to all occupancy sessions, including bare jid occupancy sessions. Messages to the MUC room MUST be accepted from all occupants, irrespective of whether they're presence-based occupancy sessions or bare jid occupancy sessions, and regardless of </p> |
There was a problem hiding this comment.
What is the from attribute of a MUC PM message when sent to an occupant that has a MUC1 presence-based occupancy session and a MUC2 bare jid occupancy session at the same time?
Or will this be send as two/multiple messages with different from attribute? Won't this confuse the clients because they now end up receiving multiple messages for the same message, but with different from attribute?
There was a problem hiding this comment.
It really depends on how we model occupants, which is an open question with a thread on the Standards list.
The user's server's support of MUC2 is intentionally primitive at this stage, but I could see it simply not fanning out identified PMs at all, or we might need client signalling to indicate support for MUC2. I appreciate this isn't specified.
I'd expect the server would send the PM under MUC1 to the MUC1 connected client(s) as well, that'd be unchanged.
There was a problem hiding this comment.
It really depends on how we model occupants
Shouldn't it be the purpose of a XEP titled "MUC2 Addressing/Occupancy" to specify how to do Occupancy in MUC2. And not leave that part out and say "we are still discussing on list"? What is the value of this XEP if not for specifying that?
| <!-- <p>Presence can be controlled by including a presence element, qualified by the &NSMUC2; namespace, with a single attribute of "level", within the muc2 element inside &X;. This attribute can be "none", in which case no presence, including the initial presence of other occupants, is sent to the client. A presence level of "full" indicates all presence is wanted by the client - this is the default. Finally, a level of "join" shows only online/offline changes. In this last case, the presence broadcast is sent as normal, but the changes relayed will only be changes from available to unavailable (or the reverse).</p> | ||
| <p>Note that it is intended that child elements might refine this further, with the element here unchanged and acting as a default.</p> --> | ||
| <ol> | ||
| <li>Existing Occupant Presence to a MUC1 client MUST include all occupants, addressed by nickname, including those bare JID occupants that are not online. These latter MUST be normal (available) presence, and SHOULD be annotated with a &xep0310; annotation to indicate they are not online. Servers MAY also override a <show/> to 'xa', to indicate their absence.</li> |
There was a problem hiding this comment.
There is no writing which 0310 annotation should be used. 0310 currently only has two:
connection-pausedfor when a BOSH connection is pausedserver-unavailablefor when s2s connections break
Both seem unsuitable for this purpose.
There was a problem hiding this comment.
It'd be connection-paused I think; it's not listed as being specific to BOSH anywhere, though that was the only example given.
I'm not wed to using XEP-0310 here, but I thought something ought to be present.
There was a problem hiding this comment.
The only mention of connection-paused outside the bosh example is in normative text related to bosh:
Benvolio's client then uses the BOSH 'pause' feature for suspending the session. The montague.lit server MUST then send an annotated presence to Romeo's client saying that Benvolio's session has been paused. This MUST include the connection-paused element, MUST include a 'from' attribute of the entity doing the annotating (montague.lit) and MAY include a human-readable description element
In other words, there is no writing in XEP-0310 that connection-paused may be used except for the one case of BOSH.
There was a problem hiding this comment.
Why would we send presence for "occupants" who are not online? Isn't that just confusing?
There was a problem hiding this comment.
'45 ties presence state to occupancy, yes, but this spec aims to break that tie. Eventually, I'd expect to be able to PM offline occupants, bring them into group calls, and so on, none of which are possible if they're not occupants, or if the other clients don't know about them.
There was a problem hiding this comment.
Affiliations don't have any stanza routing, and an affiliation of "none" is equivalent to, and implemented as, no affiliation at all. Every Jid in the network has an affiliation with every chatroom in the network otherwise. Affiliations are also given (or not) with the jid. In a [semi-]anonymous room, the affiliations are not accessible as a list anyway. OMEMO in a MUC relies on this affiliation list being public; and honestly it's a hack. If we can "fix" offline occupants (and this is done here via bare jid occupants) then we can handle these use cases much better.
If you want to look at it another way, in PubSub the affiliations are the same (more or less), but the occupants in '45 are equivalent to subscribers in '60. These are clearly orthogonal in '60; they are in 45 as well.
This conversation is a waste of time as you're clearly going to reject this anyway, but the intent here (as noted in the document) is that bare jid occupants give us the tooling and structure to build more features on top, such as push notifications and similar features that require stanza routing. Bare jid occupants get stanzas routed to them within this spec; affiliated users do not.
There was a problem hiding this comment.
Bare jid occupants get stanzas routed to them within this spec; affiliated users do not.
The only thing the spec does is to request the server to not act RFC6121 compliant by not returning an error (which they MUST, according to 8.5.2.1.1).
We already have enough examples for "failed" XEPs that provided the "tooling and structure" but not the actual usecases and then later it was found they are neither fit nor needed for the actual usecase. I would suggest to first create XEPs for the actual usecases and once you established two or more XEPs for actual usecases that could profit from having a common tooling and structure, you can still create such as a XEP and adjust the usecase XEPs to use your tooling XEP.
Regarding stanzas routed, there is prior art to using affiliation for that. Tigase supports that out of the box, Prosody has a module for this (mod_muc_offline_delivery). As part of the XEP-0077 registration form, clients can request to receive messages to their bare jid when offline.
For push notifications the above affiliation-based stanza routing can be used. But, there is also prior art to allow clients to register for push notifications at a MUC using the same protocol they use for registering push notifications on their own server (that is XEP-0357). Again this works without requiring a "bare jid occupancy": offline users remain offline, it's just that they receive a notification.
I don't see why routing for push notifications should be tied to a "bare jid occupancy" that shows the user as online in the room when they actually are offline. As prior art has shown, those two things are completely unrelated and push notifications can work perfectly well without being displayed as a room occupant, only using affiliation and potentially even without that.
There was a problem hiding this comment.
Taking your paragraphs in order:
-
That's the minimum required, and we're breaking a MUST by mutual consent, so it's OK (in case you think that's wrong!). This alone allows some useful behaviour, though, despite appearances, and I'm very confident that other capabilities will surface.
-
We have lots of cases of very successful XEPs that are "tooling and structure". XEP-0060 is utterly unsuccessful by most measures, except that it's heavily used in XEP-0163 - which itself is also just tooling and structure. PEP in turn is only really successful outside of its stated goals of providing a framework for rich presence, which we really don't use. Instead, it's used most for XEP-0223, itself a tooling and structure XEP to replace XEP-0049, a tooling and structure XEP that had huge traction. We also have lots of cases of XEPs which are not "tooling and structure" which have failed, like the MIX suite, or any of the myriad E2EE attempts, or XEP-0194 - XEP-0197 (some "interesting" suggestions for rich presence). I don't think that "tooling and structure" is the right discriminator, based on the evidence we have.
-
Yes, I'm aware - I used to like this approach, but after a lot of thought I think it's architecturally the wrong approach (possibly why nobody wanted to standardise it). Muclight (MongooseIM) takes an approach closer to this specification, but resource strings are mandated to be bare jids rather than resource ids, and it's far too oversimplified. MUC-SUB (ejabberd) uses an explicit subscription, wrapping offline MUC messages as pubsub events [I've only used in in closed environments with a client client per user, no idea how it copes outside of that]. I think "subscription to messaging" is much like "subscription to pubsub events", and thus orthogonal to affiliations, which are "permission levels" fundamentally. Even if we used affiliations for this, in order to get visibility you'd still need to present them as occupants (including in anonymous rooms), and you'd need it to be opt-in (like Prosody's module), and you still need server participation in some form to make it useful (almost - ejabberd's approach skips this being essential I suppose). So you're proposing doing all the same things as this specification, just combining the bare jid occupants into affiliations, without any gain as far as I can tell.
-
XEP-0357 explicitly precludes this on security/privacy grounds, and I think that's the right call. It uses a shared secret, and since this can be used to push essentially anything to the push server and thence the client device, I don't think we should be encouraging this. On the other hand, XEP-0357 can work with this specification with no changes to the wire protocol at all, which seems like a neat emergent property, and gives me a little confidence that this is the right direction.
-
I heavily dispute "perfectly well" - but also the bare jid occupancy only shows users as online in the compatibility mode for classic XEP-0045. "Online" and "Offline" is not the same as occupancy, but it's conflated in '45 - you simply can't be "in a room" without being online. "Subscribed" and "Unsubscribed" is occupancy. "Member" and "Owner" is not occupancy. I think, if you're defining "occupancy" as "who will see the messages I send to the room" - and that's the core of the definition I'm leaning toward in this specification - you have to show them as occupants in the protocol. I'd like a better way for compatibility, if there is one, but I feel any compatibility layer is going to have some hackery to it.
There was a problem hiding this comment.
I feel that to some degree this seems to really be about wording. To me an occupant of a physical room is physically present in this room. It's not enough to receive notifications that something is happening in the room to be considered an occupant. When we talk about hybrid meeting rooms, we may consider people occupant not physically present in the room, if they're currently (online) connected using the meeting room system and therefore able to speak and listen to and see other occupants as if they were physically in the room. If someone joins the room remotely and then loses connection, we typically consider them no longer an occupant (we might wait a minute for them to reconnect, but certainly being disconnected for hours doesn't make you an occupant anymore). Often, but largely independent to occupancy, you can be subscribed to a meeting room, meaning you are notified of events taking place there and even have access to room recordings.
Anyway, ignoring wording for a while, your bare jid occupancy currently has two purposes:
- Display to other users as present in the room when offline or at least display differently to how other offline users and offline affiliated users are displayed.
- Subscribe to notifications for incoming messages.
Not only do I fail to see how or why these two things need to be done together with the proposed addressing change, but also I don't see why they need to go together.
If I look at only these features individually, I can generally see why people might want to have them. And individually for them, I'd say the following:
- The user should be able to freely pick the presence send for him while offline (e.g. they might want to have their legacy pgp signature in it). It would also make sense to add a delay element or similar.
- Instead of having the message send as a type groupchat message that current RFC rules require to reject and that also mandates active server support, you could use XEP-0297 in some container element, which would even work without any further server support and allow current online clients to discover their messages if they do support such subscriptions.
There was a problem hiding this comment.
OK, I think because the join reports occupancy, we need the joiner to understand bare jid occupancies, and I'd rather minimize the numbers of extensions to get there. That's why I've kept these two together - as noted before by me and others, '45 has ended up with lots of interlocking extensions and it'd be nice to avoid the patchwork. Ideally, I'd build the entire replacement in a single XEP, batteries included, such that '45 could be eventually deprecated, but at least I'd like to get interlocking things combined. You're right that it's physically possible to make these distinct extensions, but then one would have to be predicated on the other, and if we end up putting if and how occupant jids forward traffic to the "real" jid behind them in the same XEP - and I think that's also ultimately sane since it's not specified anywhere currently - then bare jid, online, offline, etc all end up in the mix. (If you'll pardon the expression).
I agree that having the user pick their presence would be nice, good call.
For the rest of your note, and much of your comments in this thread, it could be summarised as "I wouldn't have done it that way". Which is fine, of course. But I don't follow why "I would have done it differently" means that this specification is so wrong as to be rejected.
To the specific, as I have said, ejabberd's MUC/Sub does much of what you suggest; it's wrapping in pubsub events rather than forwarded but the essential principle remains the same. MUC/Sub uses full-jid messages of type normal, so if the client is offline they don't get fanned out, but it also means you're reliant on stable resources to work properly, and there are certainly some quirks with build-up of subscriptions. My overall experience with MUC/Sub is that it's a pragmatic attempt, and quite reasonable given the constraints it needs to work within, but server involvement would be considerably better.
As I've said a few times (sigh), I've had significant operational experience with both MUC/Sub and Muclight over the past few years. I've worked on systems based on one or the other for most of the past 7 years. I dislike them both, but they equally both have features that - if done properly - would be highly beneficial. MUC/Sub was never submitted as a XEP (as far as I can recall), but had it been when I was on Council I wouldn't have vetoed it. It's ugly, and not for me, and has design problems in its current form, but it's not actively harmful. Muclight I did veto, but my reasoning was that it was a dead-end - incompatible with '45, no obvious way to extend it, and precluded anonymity. I didn't block it for not having a way for users to join rooms (really - it's by design); I assumed that would have been added during Experimental. I work on it every day now, and still dislike it - but the clean offline messages are very convenient, and luckily the other problems aren't an issue for me.
But for roughly two and a half years, my work was a system based off MUC/Sub, and while that is a design that respects the existing ecosystem much more, it was also really awkward to work with since messages change shape depending on the client state, you're utterly reliant on stable resources, and doing gatewaying middleware was awful. Admittedly, the latter is a niche case.
Ultimately, I think server-mediated MUC is going to be useful for a number of cases, and is in any case the right architectural model, so we may as well get it started - I've said as much since around 2010 or so, so I get to claim consistency (for once). This is also why MIX got server involvement in early; but it also was such a violent departure from '45 for so little gain - I'd like to this I've got the balance better with the effort/benefit here. For one thing, I think the IM server changes for minimal conformance are very straightforward; those on the room side are much more involved.
You've mentioned a couple of times that the RFC mandates rejecting groupchat messages; this is true of course, the specification points this out. You also seem to imply this means we can't change that. But this is a negotiated change. The RFC (RFC 6120, this time) also mandates using the original SASL profile for authentication (in section 6.1 / 6.3.1); SASL2 changes this, too. Servers using XEP-0078 were, similarly, still conformant to the RFC. Deviations from the base spec are fine between consenting entities.
|
For presences, this switches position of the occupant-id and the nickname (between presence payload and |
| <section2 topic="Occupancy Sessions"> | ||
| <p>Whenever a client joins a room, they start an "occupancy session". There can also be an occupancy session for their bare JID, which is independent of any client session. If at least one occupancy session exists, the room will contain an occupant JID, and the user will be considered an occupant of the room for all purposes.</p> | ||
| <p>Presence-based occupancy sessions are ephemeral for a given client session, and will not persist beyond that. This is the only type supported by &xep0045;, and these are highly suitable for many use-cases. Currently, these are also the only way for a client to obtain a continuous stream of messages and other events from a room.</p> | ||
| <p>Bare jid occupancy sessions persist across sessions and server restarts. While limited in this specification, they form the basis for advanced features such as "inbox" functionality, push notifications, and other cases where the user's server is required to have visibility of the message data even when the user is offline. Note that bare jid occupancy is distinct from affiliations entirely.</p> |
There was a problem hiding this comment.
"bare jid occupancy session"? are we conflating occupancy with membership now?
There was a problem hiding this comment.
No, quite the opposite. There's a whole section later on which explains how clients cause a bare jid occupancy to come into existence. But they are occupancies, not affiliations.
| </section2> | ||
| <section2 topic="Joining via Presence"> | ||
| <p>Joining a MUC1 room can be done with (relatively) simple presence. MUC2, as well, can be done this way, though this will not automatically create a bare JID occupancy session. To do so, the same joining presence stanza is used, but the &X; element includes a muc2 element qualified by the &NSMUC2; namespace, and the presence is normally sent to the bare JID. This will indicate to the room that MUC2 is expected, and will cause the occupancy session to be a MUC2 session.</p> | ||
| <!-- <p>While rooms can be configured as "anonymous", "semi-anonymous", and so on, users MAY express their preference as well via the <visibility/> element. If a user requests anonymity, the room MUST either honour that request or reject the join. Note that if the user has an existing occupancy session joined non-anonymously, this conflict MUST also reject the join. Typically, rooms will accept a non-anonymous join to a room that defaults to anonymous, but they MAY reject that.</p> --> |
There was a problem hiding this comment.
This is an interesting idea, but commented out? Probably it should be in or out?
There was a problem hiding this comment.
Council insisted it should be removed last time.
| <presence from='bastiano@shakespeare.example/wimsy-192837' to='court@venice.example'> | ||
| <x xmlns='http://jabber.org/protocol/muc'> | ||
| <muc2 xmlns='urn:xmpp:muc:0'/> | ||
| <nickname>Bastiano</nickname> |
There was a problem hiding this comment.
I'd suggest to re-use https://xmpp.org/extensions/xep-0172.html -- probably right on the presence too, without the intervening layers.
There was a problem hiding this comment.
We could. XEP-0172 currently explicitly rules out its use in MUC, so I avoided it. But that can be revisited.
| </x> | ||
| </presence> | ||
| ]]></example> | ||
| <p>For compatibility with MUC1, and to avoid explicit discovery, this joining presence MAY be sent to an arbitrary resource (typically, the user's requested nickname) of the room's bare JID. The factor that makes the room treat the join as a MUC2 join is the presence of the <muc2/> element with the &NSMUC2; namespace - a MUC1 room will then execute a MUC1 style join, a MUC2 room will execute a MUC2 join:</p> |
There was a problem hiding this comment.
Since this can't be done if the nick isn't resource-compatible, there could be a clarifying note reminding that any target JID is actually fine, since the server will know the desired nick from the enclosed nick element or otherwise and issue a "joined you with different name" flow as per 0045
There was a problem hiding this comment.
There could indeed. As noted, I'm quite sure this doesn't match the quality gate for Stable. But given you have identified the case, and suggested the obvious fix, I'm sure you agree this can be addressed in Experimental.
| ]]></example> | ||
| <p>The sequence of joining either type of room is broadly identical. The differences are listed in the following sections:</p> | ||
| <section3 topic="Presence Broadcast"> | ||
| <!-- <p>Presence can be controlled by including a presence element, qualified by the &NSMUC2; namespace, with a single attribute of "level", within the muc2 element inside &X;. This attribute can be "none", in which case no presence, including the initial presence of other occupants, is sent to the client. A presence level of "full" indicates all presence is wanted by the client - this is the default. Finally, a level of "join" shows only online/offline changes. In this last case, the presence broadcast is sent as normal, but the changes relayed will only be changes from available to unavailable (or the reverse).</p> |
There was a problem hiding this comment.
Another commented out section.
There was a problem hiding this comment.
Another requirement to remove it from the spec by Council last time.
| <p>Note that it is intended that child elements might refine this further, with the element here unchanged and acting as a default.</p> --> | ||
| <ol> | ||
| <li>Existing Occupant Presence to a MUC1 client MUST include all occupants, addressed by nickname, including those bare JID occupants that are not online. These latter MUST be normal (available) presence, and SHOULD be annotated with a &xep0310; annotation to indicate they are not online. Servers MAY also override a <show/> to 'xa', to indicate their absence.</li> | ||
| <li>Existing Occupant Presence to a MUC2 client also includes all occupants, but this time addressed by occupant-id, and shows bare JID occupants that are not online as offline presence.</li> |
There was a problem hiding this comment.
I assume this means to say that a presence type=unavailable should be sent for such "bare jid occupants". While I remain opposed to the concept, this is much less bad than the above proposal to send an available presence with a tag no one implements IMO
There was a problem hiding this comment.
I think that's what it does say.
XEP-0045 seems to have once allowed unavailable presence of member affiliations, judging by the status codes 102 and 103, but I'm pretty sure it's unsupported by implementations.
But having bare jid occupancies means we need a mechanism to signal them when they're offline, and the cleanest way is unavailable presence (otherwise you just get compatibility shims like I've specified for MUC1).
And I agree that XEP-0310 isn't implemented, but it seemed like the closest fit. As noted elsewhere, I'm not wed to that approach.
| <p>Many MUC2 clients will not want this feature - but it can be trivially turned off in the usual manner. MUC2 rooms MUST implement MAM, as defined in &xep0313;.</p> | ||
| </section3> | ||
| <section3 topic="Room Subject"> | ||
| <p>If a MUC1 client is joining, this will be as normal. For MUC2 clients, this will also include an additional element giving the MAM summary <metadata/> of the room, defined in &xep0313; section 5.</p> |
There was a problem hiding this comment.
What is the purpose of this mam summary? And why is it in with the subject?
There was a problem hiding this comment.
Most clients prefer using MAM to the MUC history, and supplying the MAM summary gives a useful hint as to whether they need to run a MAM query at all. There's ways we could make this more efficient, by passing in MAM ids into the join, but those then cease to be backwards compatible, and equally are easy to add in later.
| <p>To advertise support for handling bare jid occupancy sessions, the user's server MUST include a &xep0030; feature of &NSMUC2PAM;.</p> | ||
| </section3> | ||
| <section3 topic="Bare JID Joining"> | ||
| <p>Bare JIDs join the room with an &IQ; request sent by the user's server from the user's bare jid to the room's bare JID of type "set", containing a join element within the namespace &NSMUC2;, containing a nickname element. The room processes this, sending the room's current subject in the same way as a join - containing the MAM summary metadata as per &xep0313; section 5 - and respond with an &IQ; of type result which reflects the join element within &NSMUC2; also containing the nickname element. This allows the room to assign a different nickname as needed. Note that an iq-based join from a full jid (ie, one with a resource) MUST be rejected.</p> |
There was a problem hiding this comment.
Is the purpose here basically to allow the user to get access to the subject without getting live messages? MAM they can get already. Registering as a member or other affiliation seems like it should use the registration protocol.
Or I guess this is less about "joining" and more about "subscribe to MUC-PAM"? Do we need a MUC-PAM XEP for people who want that kind of thing?
There was a problem hiding this comment.
It's returned because it seemed like it might be useful. Like everything in this spec, we might decide it's not useful.
There was a problem hiding this comment.
Maybe we should find out if something is useful before writing a spec for it? ...
Take two...
Hopefully this one takes less than a month.
This only deals with the addressing and occupancy, which I believe are intrinsically linked.
There is a PoC server-side implementation here: igniterealtime/Openfire#3305