Skip to content

keyv - feat: adding in hooks for clear and disconnect#1924

Merged
jaredwray merged 2 commits intomainfrom
keyv---feat-adding-in-hooks-for-clear-and-disconnect
Mar 31, 2026
Merged

keyv - feat: adding in hooks for clear and disconnect#1924
jaredwray merged 2 commits intomainfrom
keyv---feat-adding-in-hooks-for-clear-and-disconnect

Conversation

@jaredwray
Copy link
Copy Markdown
Owner

@jaredwray jaredwray commented Mar 31, 2026

Please check if the PR fulfills these requirements

  • Followed the Contributing and Code of Conduct guidelines.
  • Tests for the changes have been added (for bug fixes/features) with 100% code coverage.

What kind of change does this PR introduce? (Bug fix, feature, docs update, ...)
keyv - feat: adding in hooks for clear and disconnect

@codecov
Copy link
Copy Markdown

codecov bot commented Mar 31, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 100.00%. Comparing base (fd5d40a) to head (ce44aa0).
⚠️ Report is 1 commits behind head on main.

Additional details and impacted files
@@             Coverage Diff             @@
##             main     #1924      +/-   ##
===========================================
+ Coverage   99.94%   100.00%   +0.05%     
===========================================
  Files          40        40              
  Lines        3974      3978       +4     
  Branches      641       641              
===========================================
+ Hits         3972      3978       +6     
+ Misses          2         0       -2     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Copy link
Copy Markdown
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request introduces new lifecycle hooks for the clear and disconnect methods in the Keyv class, specifically BEFORE_CLEAR, AFTER_CLEAR, BEFORE_DISCONNECT, and AFTER_DISCONNECT. It also updates the KeyvHooks enum and adds unit tests to verify the execution of these hooks. The review feedback suggests passing a context object (e.g., containing the namespace) to these hooks to ensure consistency with existing hook implementations and to facilitate future metadata additions without breaking the API.

@jaredwray jaredwray merged commit 1721d8f into main Mar 31, 2026
12 checks passed
@jaredwray jaredwray deleted the keyv---feat-adding-in-hooks-for-clear-and-disconnect branch March 31, 2026 14:31
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