Skip to content

Android app NPE when downloading files with bracketed IDs in name; shows misleading "server can't be reached" #170

@NPopper

Description

@NPopper

Describe the bug

The Android app fails in two stages when bracketed IDs like [B004EXIHDQ] or [B0055E6Y2E] appear in audiobook folder and file names. First, opening a folder with [ID] in its name shows an empty list and a “sync failed” toast. After renaming the folder to remove the [ID], the files appear, but downloads still fail with a “server can’t be reached” toast until the files themselves are also renamed to remove the [ID].

Steps to reproduce

  1. In the Android app, navigate to /Media/audiobooks/.
  2. Open a folder with bracketed ID in the name, e.g.:
    • /Media/audiobooks/Guards! Guards! [B004EXIHDQ]/
    • /Media/audiobooks/Miss Peregrine's Home for Peculiar Children [B0055E6Y2E]/
  3. Observe the folder contents in the app.
  4. Rename the folder to remove the bracketed ID (e.g. remove [B004EXIHDQ]) and open it again.
  5. Try to download a file inside the renamed folder (e.g. .m4b, .pdf, .jpg).
  6. Rename the files to remove the bracketed ID and try downloading again.

Expected behavior

Folder contents are shown and files download normally, regardless of bracketed IDs in names.

Actual behavior

Phase 1 (original folder name with [ID]):

  • Folder opens empty and the app shows "sync failed".

Phase 2 (after renaming folder, but files still contain [ID]):

  • Files appear, but downloads fail with "server can't be reached".

Phase 3 (after renaming files to remove [ID]):

  • Downloads succeed.

Logs show NullPointerException in ReadRemoteFolderOperation and ReadRemoteFileOperation, followed by ServerNotReachableException.

Additional context

the two cases that failed:

  • /Media/audiobooks/Miss Peregrine's Home for Peculiar Children [B0055E6Y2E]/
  • /Media/audiobooks/Guards! Guards! [B004EXIHDQ]/

Example of a similar path that didnt faild (bracketed ID, no Android issue):

  • /Media/audiobooks/The Wise Man's Fear [B007Q36VFC]/The Wise Man's Fear - The Kingkiller Chronicle, Book 2 [B007Q36VFC].m4b

Note: The toast messages are misleading because the server is reachable and the app receives HTTP 207 responses before the NPE.

p.s. Thank you very much, the project has been working quite well despite me being a complete novice and hosting it myself.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions