25huizengek1 / ViTune

An Android application for seamless music streaming
https://vitune.app
GNU General Public License v3.0
255 stars 13 forks source link

Database doesn't import and causes a crash #268

Open Syntax-Err5 opened 1 month ago

Syntax-Err5 commented 1 month ago

Steps to reproduce the bug

  1. Export db from ViTune 1.0.3
  2. Import to latest nightly build
  3. Nightly build crashes and db is not imported (and everything that was there is wiped)

Expected behavior

Database imports songs and playlists from stable to nightly build.

Actual behavior

App crashes, db not imported

Screenshots/Screen recordings

No response

Logs

FATAL EXCEPTION: arch_disk_io_2 Process: app.vitune.android.nightly, PID: 26244 android.database.sqlite.SQLiteDatabaseCorruptException: database disk image is malformed (code 11 SQLITE_CORRUPT) at android.database.sqlite.SQLiteConnection.nativeExecuteForCursorWindow(Native Method) at android.database.sqlite.SQLiteConnection.executeForCursorWindow(SQLiteConnection.java:1030) at android.database.sqlite.SQLiteSession.executeForCursorWindow(SQLiteSession.java:838) at android.database.sqlite.SQLiteQuery.fillWindow(SQLiteQuery.java:62) at android.database.sqlite.SQLiteCursor.fillWindow(SQLiteCursor.java:145) at android.database.sqlite.SQLiteCursor.getCount(SQLiteCursor.java:132) at M2.r.J(SourceFile:37) at Q2.v.a(SourceFile:13) at Q2.v.e(SourceFile:43) at r0.v.run(SourceFile:27) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:644) at java.lang.Thread.run(Thread.java:1012)

ViTune version

1.0.3

What kind of build are you using?

Nightly (F-Droid)

Android version

Android 13

Device info

Oppo A54 5g, running ColorOS 13

Upstream reproducibility

No response

Additional information

This issue has been reported already in #61 and #250, but hopefully the logs will help

Checklist

Enigma1309 commented 1 month ago

that db isn't loading but you gave your piped credentials to public..it's in your database...(make sure to log out of piped session and then backing up)

Enigma1309 commented 1 month ago

image

Syntax-Err5 commented 1 month ago

Woah thanks for pointing that out, I didnt realise it backed that up too Changing my password 😅

Syntax-Err5 commented 1 month ago

Here's a new db with the same problem: ViTune_backup_20240509172054.zip

25huizengek1 commented 1 month ago

Woah thanks for pointing that out, I didnt realise it backed that up too Changing my password 😅

Funny thing is that I already considered something like this would happen with Piped accounts, yet still I haven't changed anything about the way this works. Maybe something for a separate issue ticket?

25huizengek1 commented 1 month ago

Now for the error, I guess this has something to do with the fact that I update the Room dependency every now and then, which may cause some unexpected behavior like this. I'll try to find out why this is after my final exams, because this seems a bit complicated.

fakeworldxd commented 1 month ago

I am also unable to restore data from vitune db file, on 1.0.4 But I was able to restore data from an older vimusic db onto vitune 1.0.4 I've tried this again with music you (another fork of vimusic) and it behaved in the same way Guess I'll stick using the old db until the fix comes out 😅

Also I hope to see a system which allows vitune db to be compatible with other vimusic forks (if possible) - I believe it can be done by letting the user choose what data to backup at the time of backup instead of backing up all data

25huizengek1 commented 1 month ago

I believe it can be done by letting the user choose what data to backup at the time of backup instead of backing up all data

Interesting idea, I think letting users export for ViMusic v0.5.4 and calling it 'compat mode' should do the trick, no?

Enigma1309 commented 1 month ago

Interesting idea, I think letting users export for ViMusic v0.5.4 and calling it 'compat mode' should do the trick, no?

yeah and also i suggest to remove the piped credentials from the db.

fakeworldxd commented 1 month ago

I believe it can be done by letting the user choose what data to backup at the time of backup instead of backing up all data

Interesting idea, I think letting users export for ViMusic v0.5.4 and calling it 'compat mode' should do the trick, no?

Yeah, I think that'll work.

davidpkj commented 1 month ago

Hi, I don't know if it's relevant but thought I'd share:

Had the same problem on a new install. Then (after trying around for a while) I first cleared all app data in android settings and then played a random suggested song for a few seconds and tried importing again. Then importing worked flawlessly. Both versions of the app (export and import side) were 1.0.4.

Maybe playing a song initialized someting somewhere...? Anyway hope it helps.