piggz / harbour-amazfish

Amazfit Bip support for SailfishOS
GNU General Public License v3.0
103 stars 52 forks source link

Downloading Sports Activities corrupts database #140

Open vigejolla opened 4 years ago

vigejolla commented 4 years ago

In the latest version (1.7.11.7.1.20201013113553.5d4533a), downloading sports activities results in database corruption (at least I think so). After the downloading has finished, all data disappears from amazfish UI.

After some time it seems the database gets somehow back to a working status as all other data appears again in the UI, but the downloaded sports activity does not. The gpx file appears in the filesystem though.

I can later debug this further, but I just figured I should file the issue before I forget.

piggz commented 4 years ago

Are you sure? Ive just downloaded around 10 activities in quick succession without issue.

vigejolla commented 4 years ago

So clearly something is wrong on my device. I suppose the easy way out would be just wipe everything and reinstall amazfish, but maybe we should anyway try to find out what's causing the issue? I'll record my afternoon run today, download the data, and after the data vanishes from the UI I'll grab the database and send it to you for inspection?

piggz commented 4 years ago

Sure, also, send the logs from journal for harbour-amazfishd, and logs from running the UI if possible ... they have separate db connections.

vigejolla commented 4 years ago

Now, as I downloaded the sports activity while logging everything, it naturally worked flawlessly. I'll just close the issue now and open it again if I manage to reproduce it.

vigejolla commented 3 years ago

So this issue is back. Well, my original assumption about database corruption was not exactly correct, it was just that after trying to download sports activity, all data disappeared from the UI (like I originally wrote). But the database has not been corrupted - closing the app, killing the daemon, repairing the watch makes the old data appear again. But now I'm not able to download any sports actitivies at all as the end result is always the same.

When this happens, this message appears in journal: joulu 29 09:59:09 Sailfish harbour-amazfishd[8470]: [W] unknown:0 - KDbResult: CODE=260 MESSAGE="Virhe SQL-lauseen suorituksessa." ERR_SQL=KDbEscapedString:"COMMIT" SERVER_ERROR_CODE=0 SERVER_MESSAGE="database is locked"