Author Topic: Ability to interrupt synchronization  (Read 5869 times)

StR

  • Hero Member
  • *****
  • Posts: 1558
Ability to interrupt synchronization
« on: May 21, 2016, 11:54:27 am »
Kostya, on several occasions, I've experienced a situation when Aquamail is doing its scheduled synchronization and I need it to stop, but it's impossible. 
It would be nice to be able to stop synchronization in progress.
Yes, you may argue that it takes only seconds. But it depends on the connectivity,  and multiplied by several accounts, that time can become substantial. And, at least in one of the scenarios when it would matter, the slow connection is the reason why it is critical to prioritize internet for another app that I need to connect urgently.
Use case example: driving a car and waiting for the maps (or some other app) to get the information ASAP, while Aquamail is consuming the data traffic (and other phone resources).
There are other non-driving situations with bad connectivity and urgent need for information via another app.

Other situations (less pressing,  but...) include when I am trying to configure something within Aquamail itself, and have to wait because that part is disabled by the sync.

One of possible waya to implement this would be to swipe away the notification.
Or, you can add a button "cancel" to the sync notifications.

mikeone

  • Hero Member
  • *****
  • Posts: 2750
Re: Ability to interrupt synchronization
« Reply #1 on: May 21, 2016, 12:04:04 pm »
Thanks to Paris Geek.
I'm not aware of this (temporary) option in the app's menu
👍

StR

  • Hero Member
  • *****
  • Posts: 1558
Re: Ability to interrupt synchronization
« Reply #2 on: May 21, 2016, 12:09:12 pm »
Paris Geek:
Thank you!
I thought it was somewhere (and i may have used it at some point),  but it is hidden in the menu that is not seen on a routine basis. Mikeone's testimony  is a good indicator of that.

So, swiping or a button as proposed above would be a good addition.
« Last Edit: May 21, 2016, 12:50:36 pm by StR »

Kostya Vasilyev

  • Hero Member
  • *****
  • Posts: 12740
Re: Ability to interrupt synchronization
« Reply #3 on: May 21, 2016, 11:35:29 pm »
I don't think this warrants a button or an always present menu item (which would increase clutter).

Now that you know what to look for...

Turning off or switching the phone's network connection works too (e.g. WiFi <-> mobile).
Creating debug logs for diagnostics: https://www.aqua-mail.com/troubleshooting/

The official FAQ: https://www.aqua-mail.com/faq/

Лог-файлы для диагностики: https://www.aqua-mail.com/ru/troubleshooting/

Вопросы и ответы: https://www.aqua-mail.com/ru/faq/

StR

  • Hero Member
  • *****
  • Posts: 1558
Re: Ability to interrupt synchronization
« Reply #4 on: May 22, 2016, 04:52:06 am »
Kostya, you know my attitude: if you don't implement that, I'll just set on fire yet another voodoo doll of you and will continue using the Aquamail I have (of course, cursing Kostya every time I encounter the problem ;)).

But in this case, your response seems to indicate that I haven't done a good explaining the use case. (I was doing that from the cell phone, and I prefer a regular keyboard.)
Turning off or switching the phone's network connection works too (e.g. WiFi <-> mobile).
So, please excuse me for trying to make sure you really understand the use case(s).

Situation: In case of a bad connectivity (could be a weak Wi-Fi when mobile network is unavailable or impractical, e.g. in case of international roaming, or a weak mobile signal and no Wi-Fi), I need some other app to use the network urgently (pull some urgent information from the network). While I am doing that (and, despite the nominal 3G/4G or WiFi,  it can be painfully slow, think of a 28.8K modem on a noisy line, if you've had that experience),  Aquamail starts its scheduled check, making that slow connection even worse.
That slows "the app of interest" to a crawl, or even can cause a timeout in the connection for that app.
A remedy in such a situation is to quickly (before the timeout might occur) cancel Aquamail's sync.

I hope now it is clear why "turning off or switching the phone's network connection " is not an option at all.

The easiest (and the quickest) way to cancel the sync qucikly would be to pull down the notifications from the top, and either swipe away the notification for the AM sync or to click a button on that notification (similar to the buttons appearing on the new message notifications).
The problem with the menu item is that it takes some time to get to it, especially when Aquamail hasn't been used recently, i.e. it might not be in the "short-list".
(And, just for the record, I didn't mean that that menu item should be made persistent. I mentioned it not being persistent just as an aside that it is hard to find it unless you know where it is.)

Besides, in one situation when it happens somewhat often, I'd be driving, and waiting for Waze or Google Maps to recalculate the directions. So, besides the time required for opening Aquamail and going to the menu, doing that while driving is not very practical. Add to that that the need for the urgent  recalculation of direction is usually a result of a non-standard situation (highway closure), which is making the entire situation a bit more ... stressful, I guess.
In another situation, I'd be trying to obtain urgently some necessary information before the network connection disappears completely: before entering an area with no data connectivity (rural part of the country, long tunnel, before the aircraft takes off, etc.).

I hope this post clearly describes some of the situations where a quick and easy way to cancel the scheduled Aquamail sync would be a great benefit. But I understand if that still wouldn't make it a priority (see the first sentence above).


Davey126

  • Sr. Member
  • ****
  • Posts: 258
Re: Ability to interrupt synchronization
« Reply #5 on: May 22, 2016, 09:51:53 pm »
Sorry for jumping in but there may be another "remedy"...

Re: A remedy in such a situation is to quickly (before the timeout might occur) cancel Aquamail's sync.

I have a similar interest in controlling sync on one of several devices running Aqua. On that device I disable scheduled syncs and instead rely on event based sync (eg: at app startup) and 'pull to refresh' as needed. This might offer a solution, possibly combined with an appropriate selection under Settings -> Mail Receiving -> General -> System Settings.
« Last Edit: May 22, 2016, 10:23:49 pm by Davey126 »

StR

  • Hero Member
  • *****
  • Posts: 1558
Re: Ability to interrupt synchronization
« Reply #6 on: May 23, 2016, 07:25:41 am »
@Davey126 and @Paris Geek:

Thank you for your suggestions. ( I really appreciate your taking the time to think about possible solutions.)

However, these workarounds are somewhat "borrowing from Paul to pay Peter". Yes, these workarounds might do some compensation for the problem I discussed, but essentially they would be disabling a regularly scheduled sync that is actively used on this phone, and which is a core of an e-mail communication.
While for some accounts (those that do not have much of urgency) it can work, it wouldn't work for the "primary" e-mail accounts.

If I were to disable scheduled sync for the "less urgent" accounts, as per Davey126's suggestion, that can shorten the sync cycle, which might "soften" the problem when it happens.
As for Paris Geek's suggestion, - I actually have sync enabled even during reading messages. So, disabling sync while the screen off is disabling a part of the used functionality. Besides, that probably wouldn't necessarily solve the "problem" completely for my use cases: If I take the phone while it was off, and it was syncing at that time, I still would need to wait until the sync is finished. (I don't expect that turning the screen on would interrupt the sync, would it?)
So, for both workarounds, I'd have to think if it would be worthwhile.

StR

  • Hero Member
  • *****
  • Posts: 1558
Re: Ability to interrupt synchronization
« Reply #7 on: May 26, 2016, 07:48:32 am »
@Kostya:
A different but related question.

I just observed the following situation:
The mail server (IMAP) has been unavailable for extended period of time. (Red "server unreachable" is shown)
I am starting the sync for an account on that server. Aquamail is trying to connect until it times out. (As expected.) Choosing "Cancel Network tasks" from the menu does not stop the attempt to connect. The attempt continues until it times out.

Is this behavior expected?
I might understand if it would not interrupt in the middle of an active synchronization (to avoid loosing some information), but it is a bit strange that the attempt is not interrupted at the stage before the connection to the server is even established.

Kostya Vasilyev

  • Hero Member
  • *****
  • Posts: 12740
Re: Ability to interrupt synchronization
« Reply #8 on: May 27, 2016, 03:30:21 pm »
It's really really really difficult to abort a currently proceeding socket connect function, or any socket function.

It may fail eventually, but won't get aborted, sorry.

It's supposed to be possible to call Thread.interrupt and then you're supposed to get an InterruptedException from the socket -- but it only works with so called NIO ("new" IO) which is a pain in the ass (like you have to implement the SSL layer yourself) and don't think any apps use that...
Creating debug logs for diagnostics: https://www.aqua-mail.com/troubleshooting/

The official FAQ: https://www.aqua-mail.com/faq/

Лог-файлы для диагностики: https://www.aqua-mail.com/ru/troubleshooting/

Вопросы и ответы: https://www.aqua-mail.com/ru/faq/

Davey126

  • Sr. Member
  • ****
  • Posts: 258
Re: Ability to interrupt synchronization
« Reply #9 on: May 27, 2016, 03:41:32 pm »
re: It's really really really difficult to abort a currently proceeding socket connect function, or any socket function.

I run into this on rare occasions with Aqua and (more frequently) other apps. My caveman approach is to either swipe the app or toggle device connections with varying but satisfactory outcomes. Obviously lacks elegance but have yet to experience any lingering side effects with my app portfolio. That said, I am normally blessed with good connectivity throughout most travels so the need is rare and permits silently exercising a part of my vocabulary not fit for public consumption. :)

StR

  • Hero Member
  • *****
  • Posts: 1558
Re: Ability to interrupt synchronization
« Reply #10 on: May 27, 2016, 05:45:36 pm »
@Kostya:
Ooh,  I see ... I"be seen it in some cases on Unix.
Thanks for the derailed response.