-
-
Notifications
You must be signed in to change notification settings - Fork 102
Description
Describe the bug
When selecting a file to import, frequently the app reports, "File read successfully, would you like to import covers," as if there had been books imported. But it becomes clear that no books were imported. This message is confusing and inaccurate.
To Reproduce
Steps to reproduce the behavior:
- Choose "import Openreads CSV"
- Select a file which is either empty, OR that the app does not have permission to read.
- App reports "success"
Expected behavior
- Select a file for Openreads to import.
- If the file cannot be read or appears empty, report that no books could be imported because the file appears empty or is not readable.
- If the file was read, report the number of books that have been (or are being) imported.
Screenshots
Not applicable
Additional info(please complete the following information):
- App version: 2.10.0
- App source (F-Droid, Google Play, Github, AppStore): F-Droid
- Manufacturer and model: fairphone FP3.5,
- OS and version: /e/OS v2.9, eq to Android 13.
Additional context
I don't know Dart, but looking at the code flows I see that in lib/core/helpers/backup/csv_import_openreads.dart line 41, within a TRY block there is:
if (csvBytes == null) return;
...I guess that this ends up looking the same as success to the calling function? And perhaps there is an exception that could be thrown instead? Some error message before the return is triggered?
I believe I'm seeing this so often because of the mess that is Android file access permissions (obviously not your fault!). There may be better ways to fix this at a higher level, e.g. ensuring that files are only taken from owned folders, or providing one of those "Share to..." entries for Openreads import.