[Discussion] How to show error states

The 3 images were meant to belong together :slight_smile: but of course we can realize images 1 and 2 but modify what happens on error (image 3)

I think 3 states (Connected, Not connected, error) would be nice, so that the user can be sure DC is connected. If we only have 2 states (error/no error) then the user won’t know if we are connected or DC is still trying to build up a connection.

If we make an FFI with two 2 states and then switch to 3 later, this will be another FFI or a breaking change, so I think we should do it from the beginning.

Doing:

if core says "connected": everyting fine, do nothing
else if there is no network: "Waiting for network..."
else if core says "error": "! Not connected" (or red exclamation mark, if we go for idea #2)
else "Connecting..." (or rotating dotted circle, as we have it for pending msgs, if we go for idea #2)

sounds pretty straightforward and not too much work for me.

BTW we can decide for a way to show the error state (e.g. my idea #1 to #3) independently of how many error states to show: If we decide for Idea #2 and 3-state just put a rotating dotted circle (as for pending messages) instead of "Connecting..."

+1

I also like the idea of a Status, which opens a page displaying your provider, whether it is connected or not etc., some troubleshooting information. And a badge hinting to look there, both on the “three dots” like an and on the menu item, to guide user where to look.

This would be really useful, especially when we have true multi-account support. I would even remove the “Delta Chat” title completely and replace it with avatar and username, and open profile editing page when clicked.

3 Likes

@link2xt that sounds like a really useful UX improvement +1

@Hocuri I also think it would be good to have more states for the status, knowing if the app is actually connected is some old users request:
Make connection status more visible

sure.

with “issues on its own” i was thinking more about how core can differ between “connection error” and “not connected now, but probably in a few seconds”. this “no network” is known to be tricky, in flaky situations, this may change several times a second.

however, i would probably be find with more states in the ui, depends a bit what the core can provide reliably with reasonable effort. we will see what we can get actually :slight_smile:

@r10s and I settled for this solution, mainly because it’s quite easy to implement:

  • We use Idea #3 Replace the title, just like Telegram. That’s doable in 1 line of code, if we want to do sth. more dedicated later, we easily can.
    States are: “Not connected”, “Connecting…” and “Delta Chat” (for “connected”)
  • While the title is “Connecting…” and “Not connected” the user can tap on the title to get to the status page, coming as html from the core.
  • In the settings, “App access” is moved to “Advanced”. Under “Advanced” we add a new item “Connectivity” that also opens this html page.

What we did not decide for, and esp. why:

  • Dedicated “Error” and “No network” states: We can’t reliably distinguish them
  • A :warning: emoji in the title bar when not connected: probably annoying to have an eye-catching :warning: there everytime there is no network
  • An entry in the menu: People probably rather look for this in the settings than in the menu. And in case this very good one day so that you would want to frequently use it, we can still move it into the menu.
  • Showing a “Getting new messages” status in the status line: It would probably be frustrating to see this state shown from time to time, and sometimes a new message arrives, sometimes not
2 Likes

After my first quick-and-dirty implementation of what I described above, I did some user-testing with my family, these are the results:

  • Added status emojis (:red_circle:, :yellow_circle:, :arrow_down:, :green_circle:) to the html page (:red_circle: for not connected, and so on)
  • Adapted error messages for SMTP:
    “Not started” → “(You did not try to send a message recently)”
    :green_circle: Connected” → “:green_circle: Your last message was sent successfully”
    because we can only know that sending the last message succeeded, not whether sending one now would succeed, and showing wrong information is veeeeery confusing.

One thing I couldn’t solve yet:

  • “Not connected” is misleading, because they think that this means that there is no internet connection, but “Not connected” can have other causes, like, a not responding server or a changed-but-not-updated-in-DC password

    Possible solutions:

    • “Not connected” → “Not connected with gmx.de” (or whatever comes after the ‘@’ in configured_addr). The problem: some people have an own domain for their emails, but no own servers. "Not connected with " and might make them think that the problem is that DC tries to connect to the server , while the server is hosted at Strato.com.
    • We can ask the system whether there currently is network and then show another error message. The problem: Sometimes the system is wrong. Also, I didn’t come up with a good message yet.

And finally, that’s a great opportunity to correctly handle the password-changed-but-not-updated-in-DC case. Maybe in another PR.

1 Like

BTW it turns out that it would be far easier to do idea #2 than I thought until now:

We can put

    try{
      Method m = menu.getClass().getDeclaredMethod(
              "setOptionalIconsVisible", Boolean.TYPE);
      m.setAccessible(true);
      m.invoke(menu, true);
    }
    catch(NoSuchMethodException e){
      Log.e(TAG, "onMenuOpened", e);
    }
    catch(Exception e){
      throw new RuntimeException(e);
    }

into onPrepareOptionsMenu() and then simply set the icon using android:icon= in text_secure_normal.xml (which is the menu, no idea why the file is called “normal”). This way, we have an icon in the menu.

Then, we can just replace the three-dots-icon with a new icon that contains a status indicator using toolbar.setOverflowIcon(ContextCompat.getDrawable(this, R.drawable.whatever));

References: https://stackoverflow.com/a/45148912/15163837, https://stackoverflow.com/a/22288914/15163837

I’d say, let’s not do this right now, but use what I described above, because I’m basically done with that already. But all of this needs some more tweaking, anyway, e.g. because “Not connected” sounds like you have no internet, not that there could be a problem with your password or the server. And we still have to better handle the password-changed-but-not-updated-in-DC case.

1 Like

one option could be to use “Waiting for network…” when there is no Internet connection, that is what Telegram does.

The thing is, what we still need is a short string that says “There might be no network, or there might be another problem when connecting to your mail server”.

But if we don’t find a good solution now, we can also postpone this. Maybe we will end up using :red_circle: :yellow_circle: :green_circle: for the connectivity, then we don’t even need such a string.

if “Waiting for network…” is also known by other other messengers, that wording is maybe a bit better, indeed.

in general, i think the approach you showed me in a/v is not that bad, just saying “Not connected” or “Waiting for network…”. even if that wording might not catch exactly 100% of cases, it is better as some colors or icons that needs explanation in any case.

also, the “Not connected” is shown inside Delta Chat, so it is not that weird to assume it has sth. to do with Delta Chat and the configured account - and not with general network, power cable, headphones (it is a bit like “Press any button to continue” → user presses “Power” button or searches for a button with the label “any” :slight_smile:

and if you tap on the string, you get detailed information.

My reason for not choosing “Waiting for network…” but “Not connected” was that “Waiting for network…” definitely says that sth. is be wrong with the network, not the server or password. Which might not be true. But of course, should we go the way of distinguishing the no-network and the error-connecting-to-server cases, “Waiting for network…” will be the best string for the no-network case.

Yup :joy:

I see, the issue is that currently core api can’t differentiate if we are not connected because device is offline, or not connected because an error etc. then IMHO it is fine for now to use “not connected” I think it is clear is the app what is not connected, it is clear for the user if mobile data/wifi is connected and other apps work etc

2 Likes

Yes, it is (was) still an issue for proper job handling in core, that ffi interface doesn’t hand over the device connection status to core.
Therefore I extended ffi interface in my own fork with this information. Thus I introduced a new “connection status” flag which is feed by device’s connect status information and connection behaviour results from mail server(s).

See https://github.com/deltachat/deltachat-core-rust/issues/2208

I thought of “Waiting for connection to server…”, that actually would cover many things, no network and no server availability…

nice, however, i fear, this wording is already too long :slight_smile: (when shown in place of “Delta Chat” what the current approach is like)

2 Likes

BTW some screenshots

Some cleaning up to be done.

The HTML (in my screenshots, all black-on-white text) is not translated because I assume that people who are interested in tech enough to read through this usually speak English. And we plan to further improve the HTML, anyway, so even if we do want to translate it, probably not yet. (fwiw they would be 7 strings to translate). What do you think?

2 Likes

Right, I should have read all posts in the thread! :grinning:

I would localize all strings, because I know any unlocalized string would “turn off” people who are no techies, and I believe Delta Chat is meant to be for people of every kind.

sure, once that is done, things will be localized, where possible and reasonable (for error messages, this is often not doable as they come eg. from the server – and, also, it is not that wise to translate them as you cannot search them in some search engine) (or you will miss the one information that would have helped you).

however, up to then, it is reasonable to stay in english, as things will probably shifted around and reworded massively :slight_smile:

1 Like