39aldo39 / DecSyncCC

Android app to sync contacts, calendars and tasks without a server using DecSync
GNU General Public License v3.0
232 stars 10 forks source link

Unexpected JSON token warning #70

Open cinghiopinghio opened 2 years ago

cinghiopinghio commented 2 years ago

Hi,

Since few days I receive weird warnings from the app on Android. The app is notifying the following:

Unexpected JSON token at offset 0: Cannot begin reading element, unexpected token: 127
JSON input:

I suspect that one file is broken but I don't know how to find that file. I checked manually the last changed files in the syncthing directory but I found nothing clearly wrong. I have no conflicting files. If I add new entries to the calendar, the devices sync without problems except the notification on Android.

39aldo39 commented 2 years ago

I have no idea how the ASCII DEL character can end up in the files, but if you use Linux I think you can look for the broken file by executing grep -re "\x{FF}" ~/.local/share/decsync.

cinghiopinghio commented 2 years ago

Unfortunately I couldn't find any weird character on the device files. The problem persisted.

Now, while forcing the same device to update to v2 for tasks, the problem is magically gone, so I cannot help with further debugging.

cinghiopinghio commented 2 years ago

Well. After sanitizing my shared folder I got a period of few days where everything worked fine.

Today after a sudden unwanted reboot of the phone, the error came back. I grepped the folder looking for the offending file without success.

Is it possible that the character ended up in the database due to a sudden forced kill of the app?

I got the annoying notification every time the app try to refresh.

cinghiopinghio commented 2 years ago

The problem was solved when I cleared the app cache through the system settings.

Which favours the database issue hypothesis.