fix: allow keychain reads without account#559
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (1)
📝 WalkthroughWalkthroughThis PR fixes a keychain binding that was rejecting single-argument JavaScript calls. The ChangesOptional Account Argument for Keychain Read
🎯 2 (Simple) | ⏱️ ~8 minutes 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
|
@codex review |
|
Codex Review: Didn't find any major issues. Swish! ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
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". |
Description
Fixes the host keychain binding so
host.keychain.readGenericPassword(service)works when plugins omit the optional account argument.The plugin API documents
accountas optional, and several providers call the method with onlyservice. The Rust binding now collects the account withRest<Option<String>>, so one-argument calls reach the keychain implementation while existing two-argument calls keep the same account trimming behavior.A regression test covers the one-argument JavaScript call so this does not come back.
Related Issue
Fixes #549.
Type of Change
Testing
cargo test keychain_read_generic_password_accepts_optional_account_arg_from_js --libcargo test --libgit diff --checkScreenshots
No UI/layout changes, behavior fix only.
Checklist
mainbranchSummary by cubic
Allow keychain reads without an account by fixing the host keychain binding to accept single-argument calls to readGenericPassword(service). This restores plugin compatibility while keeping the existing account trimming behavior.
rquickjsbinding to acceptRest<Option<String>>, so one-arg calls reach the keychain implementation; empty or whitespace-only accounts still resolve to None.Written for commit c337ea7. Summary will update on new commits.
Summary by CodeRabbit
Bug Fixes
keychain.readGenericPasswordto properly handle single-argument function calls and accept an optional second parameter for enhanced flexibility.Tests