mpcjanssen / simpletask-android

GNU General Public License v3.0
547 stars 128 forks source link

Simpletask WebDAV v10.9.2 fails to sync #1126

Closed tallishpaul closed 3 years ago

tallishpaul commented 3 years ago

Hi, thanks very much for a great app, it's really useful for me. WebDAV v10.9.1 has worked well since I installed it 2 months ago. I accept that I get the occasional conflict file on my Koofr cloud service. I use and change Simpletask multiple times most days and in > month I've only had conflicts on a couple of days, 4 files in total. I checked a bit and found no data loss. I've used a Moto-G XT1032 with unofficial LineageOS 14.1 Falcon all along, in case that is relevant. I'm not a programmer in case you hadn't guessed.

After updating from WebDAV v10.9.1 and adding credentials to settings > WebDAV on startup, my todo list is shown. However, when I make a list change it fails to sync to the server. I get a "saving of todo file failed" message (snackbar I guess), and the red line at the top stays on all the time (until I close the app I think). Conflict files appear on my Koofr cloud service.

I re-installed WebDAV v10.9.1 and it is working fine again. I'm confused why no-one else seems to have reported this issue. If it's my old phone then hey-ho, but it might be a wider problem.

mpcjanssen commented 3 years ago

@tallishpaul when you get this issue with 10.9.2 can you paste the log here? (in settings -> other -> view debug log) there was a change in the 10.9.2 sync behavior to prevent conflicts.

mpcjanssen commented 3 years ago

I can reproduce tbe issue. Will look into it.

tallishpaul commented 3 years ago

would you still like the debug? I had just sat down to update to 10.9.2. to get a debug log...

mpcjanssen commented 3 years ago

@tallishpaul I think I have a fix.

mpcjanssen commented 3 years ago

I will make a test build available later today to confirm.

mpcjanssen commented 3 years ago

@tallishpaul could you check with https://mpcjanssen.nl/artifacts/10.9.3/webdav/release/ ?

tallishpaul commented 3 years ago

@mpcjanssen that's great, it's working now. Many thanks.

mpcjanssen commented 3 years ago

@tallishpaul thanks for confirming. This versiom should be on FDroid in the next view days.

uGeek commented 3 years ago

Many thanks! The new version works perfectly

gerroon commented 3 years ago

Many thanks! The new version works perfectly

Are you sure? This new version seems to create many conflict files :( I found hundreds of todo.txt conflict files since this version came out, not sure if it is a coincidence.

It seems to me that it creates a conflict file and save changes to that one instead of writing to todo.txt Therefor multiple todo.txt clients can never share the same list. This started happening in 10.9.3

As you can see in the list below SimpleTaks writes any new additions to todo_conflict_14ace003-952e-449d-a136-5b173ad3cdba.txt instead of todo.txt I think the conflict logic seems wrong here

explorer_Pe6du3777x

If I delete todo_conflict_14ace003-952e-449d-a136-5b173ad3cdba.txt it tries to sync forever, neither updating todo.txr nor recreating this todo_conflict_14ace003-952e-449d-a136-5b173ad3cdba.txt file or another conflict file again.

@mpcjanssen Here is the reevant log portion

9-13 22:21:03.425 14734 25382 E CalendarSync:   at java.util.concurrent.FutureTask.run(FutureTask.java:266)
09-13 22:21:03.425 14734 25382 E CalendarSync:  at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:301)
09-13 22:21:03.425 14734 25382 E CalendarSync:  at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167)
09-13 22:21:03.425 14734 25382 E CalendarSync:  at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641)
09-13 22:21:03.425 14734 25382 E CalendarSync:  at java.lang.Thread.run(Thread.java:923)
09-13 22:21:38.704 14734 14734 I AlarmReceiver: Executing Alarm callback
09-13 22:21:38.704 14734 14734 I Util    : Sending file changed broadcast
09-13 22:21:38.705 14734 14734 I TodoApplication: Received broadcast FILE_SYNC
09-13 22:21:38.705 14734 14734 I TodoApplication: Loading todolist
09-13 22:21:38.705 14734 14734 I FSQ     : -> Reload
09-13 22:21:38.707 14734 25367 I FSQ     : <- Reload
09-13 22:21:38.707 14734 25367 D TodoList: Reload: From BROADCAST_FILE_SYNC
09-13 22:21:38.707 14734 25367 D FileStore: FileStore is authenticated true
09-13 22:21:38.707 14734 25367 D TodoList: Executing reloadaction
09-13 22:21:38.707 14734 25367 I Util    : Sending file sync start broadcast
09-13 22:21:38.840 14734 25367 I System.out: Authenticating for response: Response{protocol=http/1.1, code=401, message=Unauthorized, url=https://DOMAIN/nc/remote.php/dav/files/USER/Documents/todo_conflict_14ace003-952e-449d-a136-5b173ad3cdba.txt}
09-13 22:21:38.840 14734 25367 I System.out: Challenges: [Basic authParams={realm=Nextcloud, charset=UTF-8}]
09-13 22:21:39.068 14734 25367 I FileStore: Getting metadata for https://DOMAIN/nextc/remote.php/dav/files/USER/Documents/todo_conflict_14ace003-952e-449d-a136-5b173ad3cdba.txt, etag: "5d06d2d11b81610b8e64dc9d979c9232", modified: Mon Sep 13 22:13:51 CDT 2021
09-13 22:21:39.068 14734 25367 I TodoList: Remote version is same, load from cache
09-13 22:21:39.068 14734 25367 I Util    : Sending file sync done changed broadcast
smichel17 commented 3 years ago

This new version seems to create many conflict files :( I found hundreds of todo.txt conflict files since this version came out, not sure if it is a coincidence.

Are you sure they weren't created by the previous version?

mpcjanssen commented 3 years ago

I would suggest to completely uninstall simpletask webdav. Clean up the mess on the server and then reinstall. Re-opening a file from the menu should also work.

mpcjanssen commented 3 years ago

The previous version mistakenly stored the full url as the todo file location. Just updating will not change this location as it's stored in the settings. Re-installing will definitely clear this up, reopening from the menu might.

gerroon commented 3 years ago

The previous version mistakenly stored the full url as the todo file location. Just updating will not change this location as it's stored in the settings. Re-installing will definitely clear this up, reopening from the menu might.

Thanks for the reply.

Reopening the file does not cut it. I cleared the storage which did reset everything for the app then I added everything back. it seems to work now.