Skip to content
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

compose box: Show error on sending message when not caught up. #4208

Merged
merged 4 commits into from
Jul 31, 2020

Conversation

agrawal-d
Copy link
Member

@agrawal-d agrawal-d commented Jul 28, 2020

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: #3800

@gnprice
Copy link
Member

gnprice commented Jul 31, 2020

Thanks @agrawal-d !

What approach did you find for manually testing this? With a debug build, simply putting the device into airplane mode before launching the app is no good, because then it can't load the JS bundle from Metro. (The app just shows a red error screen on startup.)

@agrawal-d
Copy link
Member Author

agrawal-d commented Jul 31, 2020

I disabled remote JS debugging, this will prevent the red screen error if the JS bundle has been loaded at least once.

I went to a narrow, with the internet turned on, so that the messages are cached and then I killed the app.

I then turned off the device internet and opened Zulip again.

Then I went to the same narrow and tried sending a message.

agrawal-d and others added 4 commits July 30, 2020 23:10
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
Translates the 'Failed to edit message' string in 'handleEdit'.
As Apple puts it:

  The less text people have to read onscreen, the better.
  Try to craft a title that avoids adding extra text as a message.

  https://developer.apple.com/design/human-interface-guidelines/ios/views/alerts/

We can probably improve a lot of the text across our UI, including
error messages, including probably still this one.  But I think
this is slightly better.
The title comes before the message in the UI as presented to the
user, and they come in that order in the underlying RN `Alert.alert`
function.  It's most natural to keep them in that order for this
small helper function of ours, too.
@gnprice gnprice merged commit 20da7e7 into zulip:master Jul 31, 2020
@gnprice
Copy link
Member

gnprice commented Jul 31, 2020

That works, thanks!

Merged, with a couple of additional commits on top.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

New messages simply disappear when starting the app without internet
2 participants