What happens to the presence status of a client that abruptly disconnects?

When a client that is part of the presence set disconnects from the app, due to the app being abruptly closed or the network becoming unavailable, the effected client will continue showing as being 'present' in the presence set for about 15sec.  This is done to avoid "jitter" from clients being briefly disconnected (often seen when on the move on mobile, or changing networks), and leaving and very soon after entering.


During these 15sec, the Ably library would try reconnecting the client back to the platform. If it succeeds in doing so, the existing connection is resumed, and thus the client would never have left the presence set. However, if the client is not reconnected within 15 seconds, then the Ably platform will issue a leave event for that client.


This is in contrast to the client calling the presence `leave` or connection `close` methods, in which case, the client would immediately leave the presence set.


Further reading