Skip to content

Devel - #183

Open
paroj wants to merge 3 commits into
edgefrom
devel
Open

Devel#183
paroj wants to merge 3 commits into
edgefrom
devel

Conversation

@paroj

@paroj paroj commented Oct 25, 2026

Copy link
Copy Markdown
Owner

fixes #182

paroj added 3 commits October 25, 2026 12:30
Kryo does not run field initializers, so a stale or partially written
downloadstate2.ser can deserialize with a null songs list. restore() then
passed it to download(), which threw an NPE on songs.isEmpty() and took the
service down on every start until the app cache was cleared.

Validate the restored queue before using it and drop the saved state when it
cannot be restored. Also make download() tolerate a null list.
Caches were written directly to their final path, so a process kill during
serialization could leave a truncated file that is then read on the next
start. Write to a unique temporary file and rename it into place, only after
the Kryo stream has been closed.
deserializeDownloadQueueNow() runs on the service startup thread, so any
exception while restoring the saved queue killed the process and the next
start hit the same state again. Log the failure, drop the saved queue and let
the service come up with an empty one.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Crash on open

1 participant