Skip to content

Commit

Permalink
spec: Re-enter failures need to have a specific code
Browse files Browse the repository at this point in the history
Whilst we could recommend that customers listen for enter code failures in the range 91000 -> 91099, it is possible that the reason the re-enter fails is not that at all, such as a timeout.  As such, I recommend we lock in to a specific error code so that devs who care about this event can catch it reliably with `channel.on(‘update)` and then inspect the reason error code
  • Loading branch information
mattheworiordan committed Jan 4, 2017
1 parent ca2a57c commit a7e2da3
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion content/client-lib-development-guide/features.textile
Original file line number Diff line number Diff line change
Expand Up @@ -518,7 +518,7 @@ h3(#realtime-presence). Presence
** @(RTP5c)@ In addition, when a channel becomes @ATTACHED@, the following must happen in regards to @Presence@:
*** @(RTP5c1)@ If the "@resumed@ flag":#TH4 is true and no @SYNC@ is initiated as part of the attach, do nothing as there is no loss of continuity on the channel and no change to presence. The @PresenceMap@ is not affected and no members need to be re-entered
*** @(RTP5c2)@ If either a @SYNC@ is initiated as part of the attach and the @SYNC@ is complete, or if the @resumed@ flag is false and a @SYNC@ is not expected, all members not present in the @PresenceMap@ but present in the "internal @PresenceMap@":#RTP17 must be re-entered automatically by the client using the @clientId@ and @data@ attributes from each. The members re-entered automatically must be removed from the "internal @PresenceMap@":#RTP17 ensuring that members present on the channel are constructed from presence events sent from Ably since the channel became @ATTACHED@
*** @(RTP5c3)@ If any of the automatic @ENTER@ presence messages published in "RTP5c2":#RTP5c2 fail, then an @UPDATE@ event should be emitted on the channel, with a @reason@ set to the @ErrorInfo@ received from realtime, and @resumed@ set to true
*** @(RTP5c3)@ If any of the automatic @ENTER@ presence messages published in "RTP5c2":#RTP5c2 fail, then an @UPDATE@ event should be emitted on the channel with @resumed@ set to true and @reason@ set to an @ErrorInfo@ object with error @code@ value @91004@ and the error @message@ string containing the message received from Ably (if applicable), the @code@ received from Ably (if applicable) and the explicit or implicit @client_id@ of the @PresenceMessage@
* @(RTP16)@ Connection state conditions:
** @(RTP16a)@ If the connection is @CONNECTED@ and the channel is @ATTACHED@ then all presence messages are published immediately
** @(RTP16b)@ If the connection is @INITIALIZED@, @CONNECTING@ or @DISCONNECTED@ or the channel is @ATTACHING@, and @ClientOptions#queueMessages@ has not been explicitly set to false, then all presence messages will be queued and delivered as soon as the connection state returns to @CONNECTED@ and the channel is @ATTACHED@
Expand Down

0 comments on commit a7e2da3

Please sign in to comment.