-
-
Notifications
You must be signed in to change notification settings - Fork 670
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
New messages simply disappear when starting the app without internet #3800
Comments
Thanks for the report, @agrawal-d! Possibly related is issue #3281. A PR was made to fix that issue, but it was reverted when some tests failed. Greg suspects the code change itself is OK, but the tests need to be changed. |
I tested #3281, it does not fix this issue. |
Interesting! I don't think we've otherwise known about this issue. Marking as a priority, because messages disappearing (even temporarily so that it looks like they have completely) is a bad symptom. The one issue I see with similar symptoms is #3117. But those reports don't mention starting up without internet. I think the next step for debugging this would be to identify what step is going wrong in our normal sequence for sending a message. This goes through
A good tool for answering some of these initial questions is to use RN's remote JS debugging and look at the console, at the information we have |
I'm curious whether we might still be affected by the upstream issues with The PR is marked as fixing #2287, #2310, and #2315, and all three are still open and without activity since 2018. @roberthoenig and @gnprice did a ton of really valuable debugging work that I haven't fully absorbed, but I'll look deeper if you'd like me to. Robert's facebook/react-native issue, facebook/react-native#19709, is still open, and people are commenting to un-stale it. Robert's square/okhttp issue, square/okhttp#4079, is also still open, and Robert has commented that the issue may be in okhttp, not react-native. An okhttp maintainer first commented that it might be an Android bug, but a subsequent comment from the same maintainer seemed to suggest a solution exists within okhttp. |
Hmm! Thanks for looking into that -- I hadn't thought about that upstream issue (and Robert's fix for it!) in a while. That might indeed be a useful thing for us to pick back up, and get the fix shipped. Looking back at this particular issue, I don't actually see how that issue would cause this one, though. The effect of that upstream issue, when it bites, is I think that So I'd still be quite interested in learning answers to the debugging questions I suggested above. |
I investigated this issue today, and have answers to the first two questions:
Yes, the message appears in the outbox.
No, it does not disappear from the outbox.
I'll need to investigate further to answer this. |
export const outboxMessagesForNarrow: Selector<Outbox[], Narrow> = createSelector(
(state, narrow) => narrow,
getCaughtUpForNarrow,
state => getOutbox(state),
(narrow, caughtUp, outboxMessages) => {
if (!caughtUp.newer) {
return NULL_ARRAY;
}
const filtered = outboxMessages.filter(item => narrowContains(narrow, item.narrow));
return isEqual(filtered, outboxMessages) ? outboxMessages : filtered;
},
); |
Yep, temporarily removing if (!caughtUp.newer) {
return NULL_ARRAY;
} fixes this issue. |
I don't get the logic behind the That does not make much sense to me. In fact think there is no need for this condition at all, because whatever may be our perceived knowledge about the fetched messages, the app can still have unsent messages, and they should always be shown. So, if I were to make a PR to fix this issue, I would remove this condition. Would that be correct? |
Currently, we return a NULL_ARRAY in outboxMessagesForNarrow when 'caughtUp.newer' is false - but there is no reason to do this. We should always show outbox messages regardless of the caughtUp state because there can always be unsent messages for various reasons. So, remove the conditional that causes this. Fixes: zulip#3800.
Currently, we return a NULL_ARRAY in outboxMessagesForNarrow when 'caughtUp.newer' is false - but there is no reason to do this. We should always show outbox messages regardless of the caughtUp state because there can always be unsent messages for various reasons. So, remove the conditional that causes this. Fixes: zulip#3800.
Check if we are caught up in the current narrow, and if so, show an error when trying to send a message. This is similar to the webapp logic in [1]. [1] /static/js/echo.js:160 Fixes: zulip#3800
Check if we are caught up in the current narrow, and if so, show an error when trying to send a message asking the user to try again after some time. This prevents the user from possibly responding to a very old message when the messages after it have not been loaded yet - this can lead to the reply being out of context without the sender realizing it. Fixes: zulip#3800
A spinner is shown when you were connected when you launched the app, but while staying on the app, became disconnected, and posted a new message

However, when starting the app already disconnected from the internet, any new message posted simply disappears, and no spinner/error is shown. Happens both in PMs and in Streams.
This message appears back upon re-connecting to the internet.
The text was updated successfully, but these errors were encountered: