Baseflow / Baseflow/flutter_cache_manager
Exception after clearing cache, the code tries to delete not existing image file
- Dominant language
- Dart
- Stars
- 809
- Forks
- 510
- Avg merge
- 6m
- Merged PRs (30d)
- 1
Description
After executing
await DefaultCacheManager().emptyCache();
to clear cache, and immediately refresh images, I get exceptions in the library code trying to delete non existing files.
**I have noticed 3 missing awaits when calling _removeCachedFile in cache_store.dart. Adding the 3 missing awaits solves the issue for me...**
I think missing awaits calling _removeCachedFile produces internal awaits not waiting code execution, and that's the reason exceptions trying to delete non existing files, even if the code checked that the file exists.
Can anybody add the missing awaits in the code please?
Contributor guide
Research direction
Inspect cache_store.dart and locate the three calls to _removeCachedFile described in the issue. Start by tracing the cache-clearing and image-refresh flow, then verify the behavior by clearing the cache and immediately refreshing images. Done means the reported exceptions no longer occur.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- dart, flutter
- Domain
- mobile-dev
- Issue type
- Bug
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Stale
- Clarity
- Clearly specified
- Newbie friendliness
- 52/100