Skip to content

close CacheStore in CacheManager.dispose and cancel internal timer#418

Open
EdwynZN wants to merge 2 commits intoBaseflow:developfrom
EdwynZN:develop
Open

close CacheStore in CacheManager.dispose and cancel internal timer#418
EdwynZN wants to merge 2 commits intoBaseflow:developfrom
EdwynZN:develop

Conversation

@EdwynZN
Copy link

@EdwynZN EdwynZN commented May 30, 2023

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

Bug Fix

⤵️ What is the current behavior?

When closing the CacheManager (using whatever state management or manually Provider, Bloc, Riverpod, etc) and the internal clean up schedule timer of the store is still running there is an Exception thrown by the CacheInfoRepository if its implemented by an SQL/NoSQL package (Hive for example) because it tries to use a repository that is already closed

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

CacheManager closes the internal store and by doing that, the store closes the repository used and also stops the timer in case it's running

💥 Does this PR introduce a breaking change?

No

🐛 Recommendations for testing

Close the cacheManager after using it

📝 Links to relevant issues/docs

🤔 Checklist before submitting

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

contactjavas added a commit to tentram/flutter_cache_manager that referenced this pull request Sep 18, 2023
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.

1 participant