Skip to content

Check if file in mem cache exists #190

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

Merged
merged 4 commits into from
Jun 14, 2020
Merged

Check if file in mem cache exists #190

merged 4 commits into from
Jun 14, 2020

Conversation

renefloor
Copy link
Contributor

Could fix #135

✨ What kind of change does this PR introduce? (Bug fix, feature, docs update...)

Bug fix

⤵️ What is the current behavior?

Currently the store doesn't check if a file exists when it has a CacheObject in memory.
When the file is removed by the file system the store still returns it as though the file does exist.

🆕 What is the new behavior (if this is a feature change)?

When return the object in memory it checks if the file exists and doesn't return it otherwise.

💥 Does this PR introduce a breaking change?

No

🐛 Recommendations for testing

I tested the example app with the flow in #135 (comment)

In the old situation I could clear the cache and the app still says it loads the file from cache. In the new situation it downloads the file again.

📝 Links to relevant issues/docs

Fixes #135

🤔 Checklist before submitting

  • All projects build
  • Follows style guide lines (code style guide)
  • Relevant documentation was updated
  • Rebased onto current develop

@codecov
Copy link

codecov bot commented Jun 14, 2020

Codecov Report

Merging #190 into develop will increase coverage by 0.06%.
The diff coverage is 100.00%.

Impacted file tree graph

@@             Coverage Diff             @@
##           develop     #190      +/-   ##
===========================================
+ Coverage    73.28%   73.34%   +0.06%     
===========================================
  Files           13       13              
  Lines          423      424       +1     
===========================================
+ Hits           310      311       +1     
  Misses         113      113              
Impacted Files Coverage Δ
flutter_cache_manager/lib/src/cache_store.dart 88.04% <100.00%> (+0.13%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update dac95d4...6aeb1ad. Read the comment docs.

@renefloor renefloor merged commit 477f097 into develop Jun 14, 2020
@MichaelMarner MichaelMarner mentioned this pull request Jun 17, 2020
4 tasks
@renefloor renefloor deleted the feature/filecheck branch November 19, 2020 15:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

FileSystemException: Cannot open file, path = '***.jpg' (OS Error: No such file or directory, errno = 2)
1 participant