Skip to content
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

Resolved Issue #562 #569

Merged
merged 12 commits into from
Feb 16, 2025
Merged

Conversation

nope3472
Copy link
Contributor

PR Description

Fix: Clear History Issue in API Dash

Description

This PR fixes the issue where clicking "Clear History" resulted in a HiveError: Box has already been closed. The issue occurred because Hive boxes were being accessed after they had been closed.

Fixes Implemented

  • Ensured Hive boxes (historyMetaBox & historyLazyBox) are open before clearing.
  • Avoided calling deleteFromDisk() which permanently closes the box.
  • Added proper state updates in Riverpod to refresh the UI after clearing history.
  • Wrapped the logic in try-catch to prevent crashes.

Related Issues

Checklist

  • I have gone through the contributing guide.
  • I have updated my branch and synced it with the project main branch before making this PR.
  • I am using the latest Flutter stable branch (ran flutter upgrade and verified).
  • I have run the tests (flutter test) and all tests are passing.

Added/updated tests?

  • Yes
  • No, and this is why: This fix primarily ensures Hive operations execute safely and UI updates correctly. Existing tests cover similar cases.

OS on which you have developed and tested the feature?

  • Windows
  • [x ] macOS
  • [x ] Linux

@ashitaprasad ashitaprasad merged commit 9025435 into foss42:main Feb 16, 2025
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.

history page does not update after clearing history
2 participants