-
-
Notifications
You must be signed in to change notification settings - Fork 669
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
"No messages" when in fact we're loading messages #3802
Labels
Comments
This was referenced Jan 15, 2020
chrisbobbe
pushed a commit
to chrisbobbe/zulip-mobile
that referenced
this issue
Jan 17, 2020
Fixes zulip#3802. When returning to the app after the event queue has expired, there's a moment after stale data is purged when the app incorrectly believes that an empty message list is the up-to-date state, and "No messages! Why not start the conversation?" displays until fresh data arrives. Currently, state.messages and state.narrows are emptied on the DEAD_QUEUE action. Instead, we can keep the data around, and clear it in response to REALM_INIT. At REALM_INIT time, fetchTopMostNarrow, fetchPrivateMessages, and (sometimes) fetchMessagesInNarrow are called to ensure the stale data is refreshed. All of these handle the loading state correctly, by doing MESSAGE_FETCH_START (set loading to true) -> wait for messages -> MESSAGE_FETCH_COMPLETE (set loading to false). Clearing the messages in MESSAGE_FETCH_START was considered but rejected; there are cases (fetchNewer and fetchOlder) when we want to keep messages around while fetching new ones. Doing it at INITIAL_FETCH_START was rejected because, like DEAD_QUEUE, it is dispatched before the /register request. REALM_INIT seems like the logical place to do it. It is only dispatched from doInitialFetch, so any unintended consequences should be pretty self-contained.
This was referenced Jan 17, 2020
chrisbobbe
pushed a commit
to chrisbobbe/zulip-mobile
that referenced
this issue
Jan 30, 2020
Fixes: zulip#3802. When returning to the app after the event queue has expired, there's a moment after stale data is purged when the app incorrectly believes that an empty message list is the up-to-date state, and "No messages! Why not start the conversation?" displays until fresh data arrives. Currently, state.messages and state.narrows are emptied on the DEAD_QUEUE action, which is dispatched before the /register request. Instead, preserve the stale data until /register completes, clearing it in response to REALM_INIT. In doInitialFetch, fetchTopMostNarrow, fetchPrivateMessages, and (sometimes) fetchMessagesInNarrow are also dispatched after /register to ensure the stale data is refreshed. All of these already handle their loading states correctly, on a per-narrow basis in state.fetching. Clearing the messages in MESSAGE_FETCH_START instead of REALM_INIT was considered but rejected because MESSAGE_FETCH_START is dispatched before the /register request.
chrisbobbe
pushed a commit
to chrisbobbe/zulip-mobile
that referenced
this issue
Feb 19, 2020
…D_QUEUE. Fixes: zulip#3802. When returning to the app after the event queue has expired, there's a moment after stale data is purged when the app incorrectly believes that an empty message list is the up-to-date state, and "No messages! Why not start the conversation?" displays until fresh data arrives. Currently, state.messages, state.narrows, state.flags, and state.caughtUp are emptied on the DEAD_QUEUE action, which is dispatched before the /register request. Instead, preserve the stale data until /register completes, clearing it in response to REALM_INIT. In doInitialFetch: fetchTopMostNarrow, fetchPrivateMessages, and (sometimes) fetchMessagesInNarrow are also dispatched after /register to ensure the stale data is refreshed. All of these already handle their loading states correctly, on a per-narrow basis in state.fetching. Clearing the data in MESSAGE_FETCH_START instead of REALM_INIT was considered but rejected because MESSAGE_FETCH_START is dispatched before the /register request.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
This is perhaps the most conspicuous bug I regularly see at present when using the app. I see it on v26.20.143, and I think I've been seeing it on previous versions for weeks at least, perhaps longer.
The typical sequence is:
I think basically what's going on is:
DEAD_QUEUE
(when we learn the event queue has expired), but atREALM_INIT
(kind of misnamed; dispatched when the new/register
completes.)Some history (which I haven't fully reread and absorbed) for cross-reference:
See also chat discussion. There's an issue affecting MessageReactionList, where
state.messages
has no message with the expected message ID, which potentially is how the same underlying issue shows up if in step 1 you were looking at a reaction list rather than a message list.The text was updated successfully, but these errors were encountered: