Health Check: General updating spinner #20
adamantmm
announced in
Dev Guidelines & Docs
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
See also: Health Check: Algorithm, General Description
How to Check if the “Chats are Loading” Spinner Should Be Shown in the Header
The absence of a spinner in the header guarantees to the user that they are seeing the latest list of chats and messages.
Algorithm
Show spinner in any of the three connection absence statuses:
No internet connectionNo active ADM nodesNo enabled ADM nodesIf connection and active nodes exist — check further:
/chats/get?fromHeight=returned the newest messages, meaning no newer ones exist), save in the store the timestampchatActualUntilINTERVAL= polling interval for new chats over REST (may differ depending on whether a socket connection is available)Subscriptions:
chatActualUntilchatActual = chatActualUntil > currentTimechatActualUntilhas not changed (no new messages)Show spinner if:
!chatActualOn restore from background:
chatActualUntilWorst Case
If the connection is lost, the user may not see the spinner (and mistakenly think everything is up-to-date) for a maximum of:
INTERVAL + CHAT_ACTUALITY_BUFFER_MSseconds.Beta Was this translation helpful? Give feedback.
All reactions