The EnterPresenceWorker does nothing if the trackable is being or has been removed. It asynchronously waits for the ably channel to become attached, and then performs a presence enter operation. If waiting for the ably channel to attach results in failure, then FailTrackable work should be posted.
If presence.enter fails for a non-fatal reason, then retry after 15s. A non-fatal error is defined as any error that ably does not define as fatal (these are status codes 400 -> 499) or the fatal error "Enter presence on suspended channel" which is code 91001.
If presence.enter fails for a fatal reason, then FailTrackable work should be posted.
On presence.enter succeeding, EnterPresenceSuccess work should be posted.
An unexpected async error results in the EnterPresence work being requeued.
EnterPresenceSuccess work marks the trackable as having entered presence, re-resolves resolutions and asks the publisher to update trackable states. It does nothing if the trackable has been removed.
This change also requires an update to ably.connect()
to stop that method from performing a presence enter automatically (moving the enter operation to the worker).
Implement the following workers from AAT Android:
The
EnterPresenceWorker
does nothing if the trackable is being or has been removed. It asynchronously waits for the ably channel to become attached, and then performs a presence enter operation. If waiting for the ably channel to attach results in failure, then FailTrackable work should be posted.If presence.enter fails for a non-fatal reason, then retry after 15s. A non-fatal error is defined as any error that ably does not define as fatal (these are status codes 400 -> 499) or the fatal error "Enter presence on suspended channel" which is code
91001
.If presence.enter fails for a fatal reason, then FailTrackable work should be posted.
On presence.enter succeeding, EnterPresenceSuccess work should be posted.
An unexpected async error results in the EnterPresence work being requeued.
EnterPresenceSuccess work marks the trackable as having entered presence, re-resolves resolutions and asks the publisher to update trackable states. It does nothing if the trackable has been removed.
This change also requires an update to
ably.connect()
This work is dependent on: