Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Etesync doesn't sync #1893

Open
tzugen opened this issue Jun 3, 2022 · 15 comments
Open

Etesync doesn't sync #1893

tzugen opened this issue Jun 3, 2022 · 15 comments

Comments

@tzugen
Copy link

tzugen commented Jun 3, 2022

I have the Etesync app installed (for calendar sync), but the account is tasks is defined with the native Etesync support.
Unfortunately entries I add on the smartphone don't end up on the server.
The server shows last changes from beginning of May.

Pulling down the list doesn't seem to start a sync either.

@tzugen
Copy link
Author

tzugen commented Jun 3, 2022

Logcat shows this:

WM-WorkerWrapper: Worker result RETRY for Work [ id=0000000000000000000000, tags={ org.tasks.jobs.SyncEtebaseWork } ]

@tzugen
Copy link
Author

tzugen commented Jun 3, 2022

This is happening on a GrapheneOS without G-Play libraries

@abaker
Copy link
Member

abaker commented Jun 3, 2022

Have you disabled GrapheneOS's internet connectivity check by any chance? There is a network constraint on sync jobs that I believe relies on this check

@tzugen
Copy link
Author

tzugen commented Jun 3, 2022

I had a look the the running work jobs and it was actually run OK and the constraints were satisfied.
I added the same account again and it still didn't work.
I uninstall Ed the app and reinstalled and it worked.

I didn't find a way to look at some logs except trough logcat, which was very basic, is there a way?

@felschr
Copy link

felschr commented Jul 31, 2022

I have noticed this issue on my CalyxOS device as well. It hasn't been syncing for quite a while. I can't say exactly when it stopped working, though. Today I tried setting the app up again, and it doesn't sync anything at all.

@mek-x
Copy link

mek-x commented Aug 10, 2022

I have exactly the same issue on LineageOS. It was working for a month and suddenly it stopped. The same logcat entry, i.e.:

WM-WorkerWrapper: Worker result RETRY for Work [ id=0000000000000000000000, tags={ org.tasks.jobs.SyncEtebaseWork } ]

I'm running self-hosted etebase server and I can confirm that I haven't received any messages from the device, when it stopped working.

@tzugen
Copy link
Author

tzugen commented Aug 11, 2022

For me it helped to change the URL manually to something else, and then back to the right value, this seemed to clear the error
It cleared the error, but it still doesn't sync

@mek-x
Copy link

mek-x commented Aug 11, 2022

For me, it doesn't help. Even removing and adding the account with different URL. At the same time I have enabled other service (Google Task), which syncs fine. The same log entry I've mentioned is giving SUCCESS for that worker and still RETRY for EteSync worker.

@tzugen
Copy link
Author

tzugen commented Aug 16, 2022

You are ri

For me, it doesn't help. Even removing and adding the account with different URL. At the same time I have enabled other service (Google Task), which syncs fine. The same log entry I've mentioned is giving SUCCESS for that worker and still RETRY for EteSync worker.

You are right. Changing the URL cleared the error, but still it doesn't sync

@tzugen
Copy link
Author

tzugen commented Aug 16, 2022

From looking at the code, it looks like this function is the only relevant one which can trigger a retry:

synchronized(LOCK) {
if (preferences.getBoolean(syncStatus, false)) {
return Result.retry()
}
preferences.setBoolean(syncStatus, true)
}

Might it be simply that this preference is getting corrupted somehow?

@tzugen
Copy link
Author

tzugen commented Aug 16, 2022

It would make totally sense. Once this boolean is accidentaly left in true state, no sync will ever be successful after.

@tzugen
Copy link
Author

tzugen commented Aug 17, 2022

@abaker
I have figured it out. It is indead a problem with the Boolean preference (see post above).
it is supposed to be flipped to false in the finally clause, but what happens when the phone suffers an unexpected dirty shutdown (maybe some power issue) or crash or whatever?

In this case the finally clause might not be executed, and from that on the boolean will be left in true state, with no way to recover expect removing the app (and losing all changes) and reinstalling.

One idea might be to make this setting actually a timestamp string, and if the timestamp is older than XX hours, ignore it when scheduling a new job.

I have installed the App from sources on my phone and added one line to manually get into this state, and it mirrors exactly what I experienced before.

@abaker
Copy link
Member

abaker commented Aug 17, 2022

Thanks for investigating this! The app is resetting those sync flags on startup, but it looks like I never added the etesync v2 flag 😞

Hopefully ba11ec2 fixes it

@tzugen
Copy link
Author

tzugen commented Aug 18, 2022

Oh well :)
Its always these situation where you manually need to add something elsewhere afyer copying a class 🤷

@tzugen tzugen closed this as completed Aug 18, 2022
@tzugen tzugen reopened this Aug 18, 2022
@tzugen
Copy link
Author

tzugen commented Aug 18, 2022

Would it not maybe better to store this flag in the Companion class? Then it would persist through the lifetime of the app, but once its quit or restartes it will be cleared without any additional action?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants