-
Notifications
You must be signed in to change notification settings - Fork 881
fix: FileNotFoundException after application cache got cleared #1922
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
|
@Gustl22 can you have a look? 🙏 |
|
Thank you for the contribution and sorry for the delay! |
| if (!loadedFiles.containsKey(fileName) || | ||
| // the file can be removed from the cache, this | ||
| // can happen automatically when the storage is almost full | ||
| (!kIsWeb && !fileSystem.file(loadedFiles[fileName]).existsSync())) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would prefer to check also check for if defaultTargetPlatform == Platform.Android, if it's something that only occurs on android.
I would also prefer to use await exists to not block the thread.
Also do you have some reference (preferably of Android) we can add to the docs here?
|
@krispypen are you planning on finishing up this PR? :) |
Oh I missed the previous message, I'll update today! @spydon |
Description
When an android device is low on storage, it can happen that the OS clears the cache of the app. In that case we get a FileNotFoundException when running an audio file for the 2nd time.
Checklist
fix:,feat:,refactor:,docs:,chore:,test:,ci:etc).///, where necessary.Breaking Change
Related Issues