Hacktoberfest 2026: the issues maintainers tagged for October, open and beginner-friendly. Browse Hacktoberfest issues

Exception after clearing cache, the code tries to delete not existing image file

Open
#433 0 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
2/5
Estimated time
1-3 hours
Newbie friendliness
52/100
Issue type
Bug
Clarity
Clearly specified
Activity status
Stale
Tech stack
dart, flutter
Domain
mobile-dev

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.

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?

Dominant language
Dart
Stars
810
Forks
510
Avg merge
2d 2h
Merged PRs (30d)
11

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from Baseflow/flutter_cache_manager

All issues in Baseflow/flutter_cache_manager

Similar issues

More Dart issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.