When a message publish attempt is made whilst the connection is in a disconnected state the message is queued.
Ably: ConnectionManager.queue(): queueing event
when the connection becomes suspended connectionManager.failQueuedMessages is called
Ably: ConnectionManager.failQueuedMessages(): failing 1 queued messages, err = [r: Connection to server unavailable; statusCode=400; code=80002; see https://help.ably.io/error/80002 ]
I believe the purpose of this is to clear the message queue and callback with an error
failQueuedMessages calls completeAllMessages which in turn calls completeMessages
Here there seems to be a problem that startSerial is undefined
so the check of endSerial > startSerial is false and the queued message isnt cleared, it is then sent once the connection becomes connected
I think this has likely been the same for quite some time but afaict from other SDKs (ably-java and ably-cocoa) once the connection becomes suspended the error callbacks are called and message queue is cleared
When a message publish attempt is made whilst the connection is in a disconnected state the message is queued.
Ably: ConnectionManager.queue(): queueing eventwhen the connection becomes suspended connectionManager.failQueuedMessages is called
Ably: ConnectionManager.failQueuedMessages(): failing 1 queued messages, err = [r: Connection to server unavailable; statusCode=400; code=80002; see https://help.ably.io/error/80002 ]I believe the purpose of this is to clear the message queue and callback with an error
failQueuedMessages calls completeAllMessages which in turn calls completeMessages
Here there seems to be a problem that startSerial is undefined
so the check of endSerial > startSerial is false and the queued message isnt cleared, it is then sent once the connection becomes connected
I think this has likely been the same for quite some time but afaict from other SDKs (ably-java and ably-cocoa) once the connection becomes suspended the error callbacks are called and message queue is cleared