keyv - feat: (breaking) moving to boolean return on set#1904
Conversation
Summary of ChangesHello, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request introduces a significant breaking change by standardizing the return type of the Highlights
Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for GitHub and other Google products, sign up here. Footnotes
|
There was a problem hiding this comment.
Code Review
This pull request standardizes the set method across multiple Keyv storage adapters (Dynamo, Etcd, Memcache, Mongo, MySQL, Postgres, Redis, SQLite, Valkey) to consistently return a Promise<boolean>, indicating the success or failure of the operation. Corresponding type definitions and test assertions were updated. A new build:sequential script was also added. The review comments suggest an improvement: the catch blocks in the set methods should emit errors for better diagnostics before returning false to maintain consistency and provide clearer feedback to users.
There was a problem hiding this comment.
💡 Codex Review
keyv/storage/mongo/src/index.ts
Line 391 in e1bb165
In the GridFS branch, setMany now derives success from Promise.allSettled(...).status === "fulfilled", but set() was changed to catch errors and return false instead of rejecting. That means a failed write (for example a stream error that returns false) is still treated as fulfilled and reported as true, so callers get false-positive success for entries that were not stored. This breaks per-entry result accuracy and can silently hide data-loss conditions in batch writes.
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #1904 +/- ##
=======================================
Coverage 99.88% 99.88%
=======================================
Files 37 37
Lines 3420 3438 +18
Branches 560 562 +2
=======================================
+ Hits 3416 3434 +18
Misses 4 4 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Please check if the PR fulfills these requirements
What kind of change does this PR introduce? (Bug fix, feature, docs update, ...)
keyv - feat: (breaking) moving to boolean return on set