Status-react: Request chat history on demand while on cellular connection

Created on 17 Jan 2019  Â·  21Comments  Â·  Source: status-im/status-react

Pivotal link

https://www.pivotaltracker.com/story/show/163186553

Problem

Currently, chats' history is requested from the mailservers regardless of what kind of internet connection is used on the device. For cellular connection, it might cause unacceptable traffic consumption.

Implementation

When network connection type changes to cellular a dialog with the next options can be shown to the user:

  1. stop chats' syncing, continue on demand/when switch back to a different type of connection
  2. continue syncing
  3. always stop syncing when such event occurs
  4. always continue syncing when such even occurs

On 1. and 2. a chosen action is applied and the same dialog is shown on next switching to the cellular network.

If the user chooses 3. or 4. a chosen action is applied and on the next occurrence the dialog "stop syncing while on cellular"/"continue syncing while on cellular" with two options can be shown:

  • ok
  • go to settings

In order to not annoy the user with all these dialogs, it should be shown once per session (or once per some period of time). If we have some connection specific badge it might be shown to the user only once at all. But we still have to make settings easily accessible from almost any screen then (as well as that force-requesting button).

Acceptance Criteria

  • when a device switches to cellular network the user can stop syncing
  • when a device switches to wifi network syncing is resumed
  • when syncing is stopped the user can demand history by tapping some button
  • network connection settings are accessible in profile settings

Notes

From UI/UX side we need:

  1. "force-requesting" button
  2. connection state badges

Most helpful comment

That's how it looks on iphone X simulator currently, gray-transparent-40 is used for separator

screen shot 2019-02-01 at 08 53 10

All 21 comments

hey @andmironov, can you take a look, please?

Started doing some explorations, here's iteration #1 (not final, needs to be discussed)
Since sync will not work by itself anymore, it has to be explicit when syncing is off, to avoid confusion

sync

Also, there should be on-demand syncing inside chats when syncing is off (i guess) cc @errorists

@andmironov is that icon a permanent fixture in the navigation bar? If so, I strongly dislike this solution, we're not Dropbox, people shouldn't have to stare at a syncing icon inside a chat app :) I think including that would also undermine the perceived reliability of the network, this stuff should work without me having to think about it and only tell me if it doesn't.
What happened with the idea that Roman suggested earlier, prompting with a dialogue on wifi -> cellular network change, we could always include a checkbox 'Remember my choice, don't ask again' to make them less intrusive? Once users decide to disable background syncing, then we could show a manual sync button, as for the UI I'd maybe start with a visually subtle snackbar since there's a PR that fixes their behaviour.

@andmironov, just one note: this issue is about syncing of messages history, not about syncing of blockchain state (which we will have soon as well). Those two processes are going to be separate.

Here's an iteration 2, based on the initial @rasom 's concept. cc @mandrigin

iteration2

btw, implementing this requires implementing the bottom sheet component. Example of how it works can be found here https://framer.cloud/AvjzY by tapping on the little arrow icon next to "Emily".

This component is super important and is used across all the app

@andmironov, i'm ok with these screens, the only question is about that grey badge with offline status. As i remember quite a lot of people are annoyed by this badge atm and also it takes too much real estate on some screens (on chats list screen it blocks access to the first chat in the list, on chat screen it blocks the whole "add contact" badge, probably something else).
Do we really want to use it?

@rasom I'll just chime in saying, the grey status bar was updated and the issues you've listed will be fixed as part of this PR https://github.com/status-im/status-react/pull/7141

@errorists, got it, thanks

@errorists @andmironov i can't find this color in "Status Color", should i still use it?

screen shot 2019-02-01 at 07 27 26

That's how it looks on iphone X simulator currently, gray-transparent-40 is used for separator

screen shot 2019-02-01 at 08 53 10

Nice catch! Please use light grey (#EEF2F5 RGB: 238, 242, 245) instead! mockup updated
(not critical or important)

So happy to see this drawer in existence! Looks great.

Any more work required? I notice:

  • The text below Stop syncing can use an update. "Until connected to wi-fi?" >Wi-Fi
  • Not sure if we can already refer to settings or update after the Settings menu has been updated

@rasom can you please describe the behavior of when the drawer would come up as currently implemented? Looks like it comes up on the login screen instead of in the chat view. Any reason for this?

@hesterbruikman please check this PR https://github.com/status-im/status-react/pull/7433 , the drawer will appear when you disable wifi

Thanks @rasom

I see the drawer also come up when Wi-Fi is disabled. I think this is cool, until 'Remember my choice is checked'.

Didn't get a background on the drawer unfortunately (on Android). On iOS nothing seemed to happen, at all. Wondering if this is because of the build not working, because I don't have a SIM card or some other reason.

screenshot_20190207-105728

Could be an issue unique to my ancient Android (6), in that case. Tried again with the build you shared, same result.

@hesterbruikman ok I see, thanks, don't have such device to test

well, I'm wrong, I have 6.0.1

@hesterbruikman what device do you have?

hmmmmm interesting, I have Android 6.0.1 as well, but on a Fairphone. Shouldn't make a difference, but apparently it does:S

Was this page helpful?
0 / 5 - 0 ratings