Author Topic: Forcing ad-hoc account sync with Tasker plug-in?  (Read 7829 times)

HippoMan

  • Newbie
  • *
  • Posts: 15
Forcing ad-hoc account sync with Tasker plug-in?
« on: November 06, 2016, 06:33:00 pm »
I have auto-sync turned off, and I'd like to use the Tasker AquaMail plug-in to force an ad-hoc sync for a specified IMAP account.

In the Tasker plug-in under "ACTIONS", I have selected "Check mail", and I have specified the account under "Which accounts".

I created a Tasker task to test this. It first launches AquaMail, then sleeps 3 seconds, and then invokes this Tasker plug-in. However, the sync does not take place in AquaMail.

How can I get Tasker to force a sync of a given account?

Thank you very much.
« Last Edit: November 06, 2016, 06:44:41 pm by HippoMan »

HippoMan

  • Newbie
  • *
  • Posts: 15
Re: Forcing ad-hoc account sync with Tasker plug-in?
« Reply #1 on: November 07, 2016, 09:49:50 pm »
I just noticed this topic:
http://www.aqua-mail.com/forum/index.php?topic=3320.0 [nofollow]

I have done the exact, same thing as you did, Kostya, and the sync is not taking place. I'm using Tasker version 4.8u5 on my 6.0.1 device.

All of my other Tasker plug-ins are working with no problem. Even though this issue might be dependent on the Tasker version, the fact that all my other plug-ins are working indicates that this problem might be somehow related to the way that the AquaMail plug-in is written.
« Last Edit: November 08, 2016, 08:57:10 pm by HippoMan »

Kostya Vasilyev

  • Hero Member
  • *****
  • Posts: 12740
Re: Forcing ad-hoc account sync with Tasker plug-in?
« Reply #2 on: November 08, 2016, 09:26:07 pm »
Re: I created a Tasker task to test this. It first launches AquaMail, then sleeps 3 seconds, and then invokes this Tasker plug-in. However, the sync does not take place in AquaMail.

Launches AquaMail as in -- brings the app up on the screen?

This is not necessary, and if you'd still like that for your own reasons, please try enabling AquaMail settings -> mail, receiving -> "when the app is active" (normally, AquaMail does not check mail when it's on the screen, since the user is "in the driver's seat").
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/

HippoMan

  • Newbie
  • *
  • Posts: 15
Re: Forcing ad-hoc account sync with Tasker plug-in?
« Reply #3 on: November 09, 2016, 07:54:34 am »
Thank you very much. Yes, I don't really need to launch AquaMail first.

In any case, I figured out how to get this to work: I need to have "auto-sync" set for my system. Once I enabled that, the AquaMail plug-in worked fine at syncing the accounts on demand.

The problem for me is that auto-sync is global for the entire device, and I don't want it set for any of my other sync-able accounts.

I found a work-around, however. I turned auto-sync off, and I have my Tasker task launch AquaMail and then utilize the "AutoInput" Tasker plug-in to automate clicking on the "refresh" icon for each account I want to sync.

That works well enough for my purposes.

Another way to do this would be for my Tasker task to (1) turn on auto-sync; (2) run the AquaMail plug-in to check mail in the accounts I'm interested in; (3) turn off auto-sync. However, that opens a short window within which other accounts might try to sync, and I want to avoid that.

Anyway, I have my work-around, so I'm happy.

Thank you again for your help.

StR

  • Hero Member
  • *****
  • Posts: 1558
Re: Forcing ad-hoc account sync with Tasker plug-in?
« Reply #4 on: November 09, 2016, 04:20:04 pm »
There is an option in Aquamail to disregard the system-wide autosync setting.

HippoMan

  • Newbie
  • *
  • Posts: 15
Re: Forcing ad-hoc account sync with Tasker plug-in?
« Reply #5 on: November 09, 2016, 06:50:13 pm »
There is an option in Aquamail to disregard the system-wide autosync setting.

Thank you!

I found that option and tried it ... and everything now works the way I want.

And also, I don't need to enable mail, receiving -> "when the app is active". I can have Tasker launch AquaMail first and then invoke the plug-in to check mail for a given account. Even without the "when app is active" setting, the sync takes place.

So, problem solved!

Thanks again to both of you!

Kostya Vasilyev

  • Hero Member
  • *****
  • Posts: 12740
Re: Forcing ad-hoc account sync with Tasker plug-in?
« Reply #6 on: November 09, 2016, 10:08:02 pm »
Re: So, problem solved!

 :)

Re: Thanks again to both of you!

Well, I'm supposed to know my way around AquaMail, but the knowledge that certain forum members about AquaMail (@StR is only one of them) sometimes really amazes me, in a good way of course. Thanks, StR!
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/

HippoMan

  • Newbie
  • *
  • Posts: 15
Re: Forcing ad-hoc account sync with Tasker plug-in?
« Reply #7 on: November 09, 2016, 11:29:54 pm »
One somewhat-related question:

Which of the following AquaMail options is more general?

1. Sync even when "Auto-Sync" is off?
2. Sync even when "Background data" is off?

In other words, if #1 is set, does it also imply #2, or if #2 is set, does it also imply #1?

I'm pretty sure that #2 also implies #1, but I want to verify.

Thank you.

StR

  • Hero Member
  • *****
  • Posts: 1558
Re: Forcing ad-hoc account sync with Tasker plug-in?
« Reply #8 on: November 11, 2016, 06:31:03 pm »
Re: Thanks again to both of you!

Well, I'm supposed to know my way around AquaMail, but the knowledge that certain forum members about AquaMail (@StR is only one of them) sometimes really amazes me, in a good way of course. Thanks, StR!
Thank you, Kostya, for your kind words.

[By the way, this is the post number 103 (=1000) for me on this forum.]


One somewhat-related question:

Which of the following AquaMail options is more general?

1. Sync even when "Auto-Sync" is off?
2. Sync even when "Background data" is off?

In other words, if #1 is set, does it also imply #2, or if #2 is set, does it also imply #1?

I'm pretty sure that #2 also implies #1, but I want to verify.

I am not sure about that.
I've never used the 2nd option myself.
"Background data" off, - I assume that references the Android setting that forbids specific apps to use mobile data while running in the background. This setting is "orthogonal" to the system setting that allows "Auto-sync", i.e. they are covering different conditions.
E.g. In Android settings you can have Background Data disabled (for mobile), and have auto-sync allowed, which would allow Aquamail to autosync on Wi-Fi. And vice-versa, you can have background data enabled, and autosync disabled, in which case Aquamail would not be allowed to autosync (unless you set "ignore that system option").
So, that suggest that the two options in Aquamail that you are asking about should be independent two, but you can choose only one or the other. So, that confuses me.

Let's consider the following 8 possible cases (the first 6 are obvious in their outcome):
1. Aquamail setting: Sync even when "Auto-Sync" is off
Android settings: Auto-sync off    (ignored)
                            Background data (on mobile) off

2. Aquamail setting: Sync even when "Auto-Sync" is off
Android settings: Auto-sync on   
                            Background data (on mobile) off

For both of them (1 and 2):
Results:
Auto-sync on Wi-Fi:  working
Auto-sync on mobile: not working


3. Aquamail setting: Sync even when "Auto-Sync" is off
Android settings: Auto-sync off    (ignored)
                            Background data (on mobile) on

4. Aquamail setting: Sync even when "Auto-Sync" is off
Android settings: Auto-sync on   
                            Background data (on mobile) on

For both of them (3 and 4):
Results:
Auto-sync on Wi-Fi:  working
Auto-sync on mobile: working

5. Aquamail setting: Sync even when "Background data" is off
Android settings: Auto-sync on
                            Background data (on mobile) off   (ignored)

6. Aquamail setting: Sync even when "Background data" is off
Android settings: Auto-sync on
                            Background data (on mobile) on

For both of them (5 and 6):
Results:
Auto-sync on Wi-Fi:  working
Auto-sync on mobile: working


7. Aquamail setting: Sync even when "Background data" is off
Android settings: Auto-sync off
                            Background data (on mobile) on

8. Aquamail setting: Sync even when "Background data" is off
Android settings: Auto-sync off
                            Background data (on mobile) off    (ignored)

For both of them (7 and 8 ):
Results:
Auto-sync on Wi-Fi:  not working
Auto-sync on mobile: not working
(IFF I understand the logic of Aquamail option correctly)

So,  for the case #8, this option in Aquamail effectively doesn't work. And that maybe confusing to some users. (I enabled to disregard "Data in the background off", why it is not syncing?)

Alternatively, maybe the logic of Aquamail option in question is different, and it means: ignore both system options: "Auto-sync" and "No data in the background [on mobile]".
In this case, the outcome would be:

7. Aquamail setting: Sync even when "Background data" is off
Android settings: Auto-sync off                                  (ignored)
                            Background data (on mobile) on

8. Aquamail setting: Sync even when "Background data" is off
Android settings: Auto-sync off                                  (ignored)
                            Background data (on mobile) off    (ignored)

For both of them (7 and 8 ):
Results:
Auto-sync on Wi-Fi:  not working
Auto-sync on mobile: not working


@Kostya: Could you please clarify this option?
And it looks to me that this confusion warrants one of the following two changes:
1. Separating the two options in Aquamail or
2. Clarifying that Aquamail setting: "Sync even when "Background data" is off" also overrides "Auto-sync Off" system option.

HippoMan

  • Newbie
  • *
  • Posts: 15
Re: Forcing ad-hoc account sync with Tasker plug-in?
« Reply #9 on: November 12, 2016, 02:39:46 am »
I was simply asking about the intent of those two settings. Thank you for all that investigative work!

Yes, I also have been confused because "auto-sync" and "background data" are independent features on Android, and yet, the two options I mentioned are mutually exclusive in the AquaMail settings.

Since I rarely use WiFi, I would never have background data turned off on my device, so I guess that the only meaningful AquaMail setting for me would be "Sync even when 'auto-sync' is off". I never want any of my accounts to auto-sync under any circumstances, and so I always want that AquaMail setting to be turned on.

And I agree that it would definitely be clearer if those two AquaMail settings were not mutually exclusive.






Kostya Vasilyev

  • Hero Member
  • *****
  • Posts: 12740
Re: Forcing ad-hoc account sync with Tasker plug-in?
« Reply #10 on: November 12, 2016, 09:08:00 pm »
Which of the following AquaMail options is more general?

Quote
1. Sync even when "Auto-Sync" is off?
2. Sync even when "Background data" is off?

The "generality" of these matches the respective Android concepts.

Goes like this:

- "Observe all system settings" -> Do not sync if either "auto-sync" is off or "background data" is off

- "Sync even when auto-sync is off" -> AquaMail will sync if "auto-sync" is off, but "background data" is still on

Could be rephrased as "Observe background data system setting only, ignoring auto-sync system setting".

- "Sync even when background data is off" -> AquaMail will *try* to sync if "auto-sync" is off and "background data" is off

Rephrase: "ignore all (both) system settings".
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: Forcing ad-hoc account sync with Tasker plug-in?
« Reply #11 on: November 13, 2016, 01:12:22 am »
Thanks for the clarification. This logic makes sense. Indeed, it need to be rephrased. The 3rd option would be probably better as follows:  "Ignore system setting disabling background sync on mobile networks and autosync".
2nd: "Ignore system setting disabling autosync".

It's interesting that the app can override the system setting for the background data. I thought that setting was "absolute", and always relied on it while traveling to foreign countries.
Is it different fro 4.x and 5.x+ ?

Geezer

  • Guest
Re: Forcing ad-hoc account sync with Tasker plug-in?
« Reply #12 on: November 13, 2016, 04:04:33 am »
This is indeed confusing.  I would suggest the following change to the "System settings" dialog.  The two proposed options would be changed to checkboxes (each can be set), not radio buttons (only one selection).  Default settings: unchecked.


Mail, receiving > "System settings" changed to "System overrides".


Dialog title: System overrides


<checkbox> Ignore system "Auto-Sync" setting
<checkbox> Ignore system "Background data" setting


Current user settings would need to be converted to the new scheme.

HippoMan

  • Newbie
  • *
  • Posts: 15
Re: Forcing ad-hoc account sync with Tasker plug-in?
« Reply #13 on: November 13, 2016, 07:10:51 am »
Goes like this:

- "Observe all system settings" -> Do not sync if either "auto-sync" is off or "background data" is off

- "Sync even when auto-sync is off" -> AquaMail will sync if "auto-sync" is off, but "background data" is still on

Could be rephrased as "Observe background data system setting only, ignoring auto-sync system setting".

- "Sync even when background data is off" -> AquaMail will *try* to sync if "auto-sync" is off and "background data" is off

Rephrase: "ignore all (both) system settings".

Thank you. This answers my original question about those settings.
.