Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Tighten up attachOnSubscribe == false behaviour
Sachin pointed out that the behaviour specified in ba79aba of ignoring the user-provided “on attach” callback (which I mentioned there I wasn’t very happy with but whose implications I didn’t fully think through) isn’t great (especially in SDKs where some mechanism other an an optional callback is used to communicate the result of the explicit attach operation, in which it’s not clear how to interpret the behaviour of ba79aba), and in #208 proposed changing the spec to say that this callback should always be called. But there was some disagreement there because some of our SDKs’ APIs (e.g. ably-cocoa) have the fact that this is an “on attach” callback baked into their names, and this can’t be changed to give this callback a new meaning. So, I’ve expanded the point to make sure: - existing SDKs can maintain API semantics where they have no alternative - the user can’t provide a callback that won’t get called - the SDK doesn’t have a method that never returns (or equivalents; e.g. it doesn’t return a promise that never resolves)
- Loading branch information