Hi all,

Implementing this one has thrown up a few observations.

1) There's a note in 3.2 that says that if resumption fails, the server MUST include the failure in the response, and then proceed to process the bind request. But, it's only just finished saying that the bind request has to be processed before sending the response. I'm being picky, of course.

2) 3.2.1 says that the <tag/> SHOULD be included verbatim, which makes sense - but then also says it SHOULD (recommended, but same thing) be a prefix. These have the same force, so why are they distinct? Do clients expect a substring here or a prefix? Obviously a prefix *is* a substring, but I'm thrown by this being included twice with RFC 2119 language.

3) 3.2.1 also says the syntax SHOULD be "tag" / "rando bit", but then follows this with Example 4, which shows a dot instead. This makes me wonder why there's a SHOULD there. Do clients expect a solidus or a period? Do they care? If not, why is this a SHOULD? Why have *three* SHOULDs relating to the same thing? The last one seems to encompass the first two, and then it's ignored in the examples.

4) When discussing the <bound/> element 3.2.1 has a SHOULD for including the MAM state - is this indicating that servers supporting Bind2 SHOULD implement MAM, and in particular the urn:xmpp:mam:2 version? Clients do not request this implicitly, unlike the other interactions, making Bind2 intrinsically bound (if you'll pardon that pun) to a specific MAM version - this is evident in the schema, in fact.
- Note that Conversations at least appears to only initiate Bind2 if MAM is supported - although doesn't appear to have any problem if the MAM summary element is omitted - making it appear as though MAM support is a MUST, despite including the metadata being a SHOULD still... Though I think the only way Conversations could know if via the caps feature hash in features, suggesting bind2 never works first time.

5) Similarly, 3.2 indicates that the server MUST do one thing that requires MAM, and another thing that relies on it being supported. 3.2.1 somewhat suggests that XEP-0280 and XEP-0352 are also mandatory to support, though I think that's just cumbersome language. Interestingly the document metadata says it does depend on MAM and Carbons - but not CSI. I don't think it does depend on Carbons, or should depend on MAM (but probably does).

6) If an inline feature request is unsupported or unrecognised, what does the server do? Ignore it silently? This is of particular interest because some inline feature requests don't have a confirmation they succeeded.

7) If authentication is successful, but bind fails, does the server say that authentication has failed? With what error? Or, is bind2 always expected to succeed? Not including the <bound/> element appears to trigger Conversations into thinking the session has not been bound, even if the authorization-identifier is a full jid. But! XEP-0388 says that a full jid here means that resource binding has occurred (that was intentional; but clearly that's not what's been implemented, so I'd better remove that!)

8) Unexpectedly, the <inline/> of the bind2 feature is mandatory even when empty; was this intentional?

9) 3.2.1 is entitled "resource identifier generation", but continues into discussing the XEP-0280 integration for example.

Fixes:

I think we may find we're doomed to stick with this version, but concretely:

a) I think I'd have MAM advertised within <inline/>, and optional. This is a breaking change, though we could circumvent it by saying that bind2 can do the MAM stuff unilaterally, and clients SHOULD include it if they want it - but that depends on what servers might do if they're faced with a MAM request they don't understand.
b) All inline features ought to have explicit confirmation, I think, but that's a breaking change. We could also include a generic inline feature failure indication ("<failed var="urn:xmpp:failed-extension:0"/>") to say that a requested feature has failed (or been unrecognised) and made no changes. And we could make an explicit confirmation at least a SHOULD for future servers.
c) I'd love to tidy up some of the specification language generally.

Fun (ish) fact: I'll almost certainly have an extraneous inline <feature var="urn:xmpp:mam:2"/> for Openfire because MAM is a plugin, and special-casing it for Bind2 will be rather awkward.

Dave.