etesync / android

EteSync - Secure, end-to-end encrypted, and privacy respecting sync for your contacts, calendars and tasks.
https://www.etesync.com
GNU General Public License v3.0
296 stars 33 forks source link

EteSync 2.4 on Android 13 not syncing tasks #226

Closed NJCLous closed 1 year ago

NJCLous commented 1 year ago

Hi Tom,

EteSync 2.4 on Android 13 (on a OnePlus 9 Pro phone) seems to have stopped syncing tasks using OpenTasks.

Symptom: If I open EteSync on the phone and tap my account, I see Contacts and Calendar both syncing properly, but Tasks has a notification "Not syncing tasks (install a provider)". The task list is headed "Change Journal" and states "Log is only shown if a task provider is installed". I have OpenTasks installed and set permissions for EteSync, OpenTasks and my calendar app aCalendar+ to access Tasks. All apps are allowed background access.

Tried and failed: I tried uninstalling EteSync and OpenTasks, then reinstalling (EteSync first, then OpenTasks) but that didn't help. I then uninstalled EteSync and OpenTasks again, reinstalled installed EteSync and enabled "Prefer Tasks.org" (as you suggested in another issue) before reinstalling OpenTasks. That didn't help either.

In EteSync on the phone, if I tap my account, then the hamburger menu to the right of the word "Tasks", a pop-up menu appears with options "Create task list", "Install Tasks.org" and "Install OpenTasks". This suggests OpenTasks is still meant to work with EteSync 2.4.

How can I reconnect EteSync to OpenTasks and get syncronisation going again?

Your help is much appreciated!

barathrm commented 1 year ago

This might not help you if you prefer opentasks, but have you tried tasks.org? https://f-droid.org/en/packages/org.tasks/

FWIW, etesync 2.3 + opentasks 1.4.2, both from f-droid, are both working fine for me on Android 13 (graphene os). You could try those versions and see which one works for you so we can try to narrow down the issues come from.

tasn commented 1 year ago

I suspect it's because the installation caused it to "undetect" it. Maybe try installing tasks.orgs and seeing if it makes it detect open tasks? Or try reinstall opentasks?

NJCLous commented 1 year ago

Hi barathrm and Tom,

I tried Tasks.org which doesn't connect with EteSync either. I did the following for Tasks.org:

Also, Tasks.org. does not sync with my calendar app aCalendar+ which wants me to use OpenTasks....

...so I proceeded as follows for OpenTasks:

...so no luck.

I have no experience with F-droid and would prefer to stick with Google Play for practical reasons. It would make sense to try the previous version of EteSync but I don't know how to get that onto my phone.

Further help is much appreciated!

Niels

NJCLous commented 1 year ago

PS: It might be relevant that my OnePlus 9 Pro uses OxygenOS 13.1 (based on Android 13, but I guess with some OnePlus-typical variations). This version was released late May; perhaps it includes a change that "blocks" EteSync from connecting to OpenTasks?

Also, EteSync never crashed before but now, when reinstalling or re-syncing, it occasionally does.

When I check the debug info, I can see that

org.dmfs.permission.READ_TASKS permission granted org.dmfs.permission.WRITE_TASKS permission granted

but

OpenTasks sync.interval: - (i.e. not set)

I tried to enable EteSync's "Log to file", hoping to capture futher details, but when I toggle that on, the app hangs.

julianfairfax commented 1 year ago

I also have this issue with the updated version from F-Droid. My tasks won't sync with Tasks.org

frostynumeral commented 1 year ago

I have the same issue with two Samsung devices (phone and tablet). Both are running Android 13 from the manufacturer. I'm using EteSync and Tasks.org installed from the Play Store. Tasks synchronization was working fine with the previous version, but now no longer.

I have tried uninstalling and reinstalling both EteSync and Tasks.org, but it didn't resolve the issue.

letscho123 commented 1 year ago

I have the same issue on Google Pixel 4a with CalyxOS (Android 13) since the latest version and using tasks.org. Downgrading EteSync to the previous working version did give an error on F-Droid.

barathrm commented 1 year ago

I can confirm that updating to etesync 2.4 from f-droid, etesync now says * Not syncing tasks (install a provider). I have OpenTasks 1.4.2 installed. Looking at the etesync debug logs, etesync says this at startup:

2023-06-11 16:38:34 14 [com.etesync.syncadapter.utils.TaskProviderHandling] Package (un)installed; Syncing (false) for OpenTasks
2023-06-11 16:38:34 14 [com.etesync.syncadapter.utils.TaskProviderHandling] Package (un)installed; Syncing (false) for TasksOrg

Downgrading directly is not possible (I get an error), however uninstalling etesync and manually installing version 2.3 makes it work fine, like before. So it seems like something about version 2.4 breaks detection of task "providers" (OpenTasks, Tasks.org).

marcdw1289 commented 1 year ago

Testing 2.4 among my other devices / ROMs. This issue does not exist on my Oreo (crDroid on Moto G5s Plus) or Pie (Havoc-OS on Moto G5 Plus) ROMs. Well, no 'Not syncing tasks' message anyway. Haven't actually tested task syncing as I never use it.

On two Android 11 devices with crDroid (OnePlus 8T) and Leos-R GSI (Essential PH-1) the issue exists.

Haven't dug into the differences yet.

networkdudee commented 1 year ago

Same issue on Android 12 Galaxy S10 #228

NJCLous commented 1 year ago

Hi Tom or EteSync colleague - it appears that several people run into this issue on a number of phones / Android versions. Reverting to EteSync 2.3 is mentioned as a temporary fix. Could you please make EteSync 2.3 available via the Google Play Store, or issue a fix to EteSync 2.4 via that channel? I don't use F-droid and don't have the expertise (or time) to get it installed. Thanks, also to all who contributed to this issue, and best regards - Niels

tasn commented 1 year ago

I wonder if something happened because of the target SDK difference that doesn't let us do this anymore because that's the main thing that changed. I won't have time to look at it in at least a couple of weeks unfortunately. :(

julianfairfax commented 1 year ago

Hi Tom or EteSync colleague - it appears that several people run into this issue on a number of phones / Android versions. Reverting to EteSync 2.3 is mentioned as a temporary fix. Could you please make EteSync 2.3 available via the Google Play Store, or issue a fix to EteSync 2.4 via that channel? I don't use F-droid and don't have the expertise (or time) to get it installed. Thanks, also to all who contributed to this issue, and best regards - Niels

Until this is fixed, and for those who don't have or don't want to use F-Droid, you can simply install the APK file for 2.3: https://f-droid.org/repo/com.etesync.syncadapter_20300.apk

NJCLous commented 1 year ago

Hi Julian - thanks for explaining how to install EteSync 2.3 without F-Droid! For other APK novices like myself: I had to uninstall EteSync 2.4, and allow apps from "other sources", before my let me install the APK for EteSync 2.3.

Tom - I hope you'll manage to make task syncing work with the new target SDK. If fixing the issue will take a couple of weeks at least, perhaps a notification on the website and within the app would reduce the number of questions about this.

pkonow commented 1 year ago

Can confirm that uninstalling EteSync version 2.4 and installing version 2.3 from F-Droid fixes the problem on GrapheneOS.

Btw. in F-Droid you can tap in the top right corner and select "Ignore this update" to skip version 2.4 and wait for the next update instead.

Sch1nken commented 1 year ago

Just to have a few more datapoints. I noticed the syncing issues too using etesync 2.4 on android. In fact, I worked on my phone (Android 10) but we had a lot of trouble with my SO's phone (Android 11). It always displayed a message about no task-providers(?) being installed. We tried manually giving all permissions (through the android settings) to no avail.

I tried Android 10 through 13 in an AVD Emulator. 10 works out of the box with 2.4. On all higher versions 2.4 does NOT work. 2.3 on the other hand works fine on all versions.

Edit: I had a look at Googles Target SDK Migration process. I am no expert on these, but found some promising pointers:

From SDK 29 to 30

  1. Package` Visibility When an app queries for the list of installed apps and services on the device, the returned list is filtered.
  2. Security - Non-SDK interface restriction. Using non-SDK interfaces is not recommended for apps targeting API level 30, as some of these non-SDK interfaces are now blocked. See Non-SDK interfaces that are now blocked in Android 11 for a comprehensive list of blocked non-SDK interfaces.

And then again Non-SDK interfaces being removed/discouraged from SDK 30 to 31 and 31 to 33.

Edit2: In case it really is the filtered package list, this might help: https://developer.android.com/training/package-visibility

Sch1nken commented 1 year ago

Okay, I think I've found the problem. I poked around a bit and tried specifying "needed" package names explicitly like mentioned here: https://developer.android.com/training/package-visibility/declaring#package-name

I tried it with the fdroid opentasks package name (org.dmfs.tasks) and that at least got rid of the pesky "no provider" message (Android 11 in AVD Emulator).

So I think just adding

    <queries>
        <package android:name="org.dmfs.tasks" /> 
        <package android:name="org.tasks" />
    </queries>

to the AndroidManifest.xml would be enough.

For opentasks and tasks.org respectively should do the trick on SDK Level 30+ and Android 11+. I'll see if I can provide a pull request tomorrow. In the meantime maybe someone is willing to do some more testing with this solution.

Also: As described in https://developer.android.com/training/package-visibility/automatic there are several ways for automatic discovery, though I am not good enough with android development to know what would fit. Maybe intent-providers for task-sync?

Edit: I tried both now (opentask + tasks.org) and it seems to be syncing fine!

NJCLous commented 1 year ago

Hi Sch1nken - thanks for your work on this. I'd help with testing your solution but I'm afraid that's technically way over my head. I hope you manage to make your pull request, and that it solves the issue! Best regards - Niels

tasn commented 1 year ago

Many thanks to @Sch1nken for the fix, I'm making a release!

tasn commented 1 year ago

F-droid should be building, and Google Play is out for review.

NJCLous commented 1 year ago

Thanks Tom! I'm glad Sch1nken and you manage to resolve the issue and look forward to the updated EteSync app. Best regards - Niels

From: Tom Hacohen @.> Sent: Tuesday, June 20, 2023 6:05 PM To: etesync/android @.> Cc: NJCLous @.>; Author @.> Subject: Re: [etesync/android] EteSync 2.4 on Android 13 not syncing tasks (Issue #226)

F-droid should be building, and Google Play is out for review.

- Reply to this email directly, view it on GitHubhttps://github.com/etesync/android/issues/226#issuecomment-1599184401, or unsubscribehttps://github.com/notifications/unsubscribe-auth/ANET5UN5DJUWROMQI7TD7EDXMHJ4ZANCNFSM6AAAAAAY4GSWEA. You are receiving this because you authored the thread.Message ID: @.**@.>>

tasn commented 1 year ago

Thanks Tom! I'm glad Sch1nken and you manage to resolve the issue and look forward to the updated EteSync app. Best regards - Niels

Only @Sch1nken deserves the credit!

Sch1nken commented 1 year ago

You're welcome! :)