API key persistence setting should be per fetcher - #16616
Conversation
PR Summary by QodoMake API key persistence a per-fetcher preference
AI Description
Diagram
High-Level Assessment
Files changed (6)
|
Code Review by Qodo
1.
|
| // Clear keys that should not be persisted | ||
| if (!keysToClear.isEmpty()) { | ||
| writeKeyring(keysToClear); | ||
| } |
There was a problem hiding this comment.
2. Trivial comments in storefetcherkeys 📘 Rule violation ⚙ Maintainability
New comments in storeFetcherKeys/clearCustomFetcherKeys restate what the immediately following code already makes obvious. This adds noise without documenting rationale.
Agent Prompt
## Issue description
Comments were added that restate the code ("Clear keys that should not be persisted", "Write keys that should be persisted", "Remove the preference keys") rather than explaining intent/why.
## Issue Context
Compliance requires comments to explain rationale and avoid trivial restatements.
## Fix Focus Areas
- jablib/src/main/java/org/jabref/logic/preferences/JabRefCliPreferences.java[2468-2475]
- jablib/src/main/java/org/jabref/logic/preferences/JabRefCliPreferences.java[2487-2490]
ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools
…tting apply only on OK) and add backward compatibility note to changelog
Remove useless comment
Summary
Changed the API key persistence mechanism from a global flag to a per‑fetcher setting. Each fetcher now stores its own “save for future use” preference, which is read and written alongside the API key in the preferences system and the system keyring. This resolves the issue where the last edited fetcher’s persistence choice was applied to all fetchers and ensures that enabling/disabling persistence for one fetcher does not affect others.
jabref-contrib-policy:4.2:reviewed:okSteps to test
Related issues and pull requests
Closes #16609, related to #16519, #16250
AI usage
Claude Code (model claude-opus-5) was used to help navigate through the files
Checklist
CHANGELOG.mdin a way that can be understood by the average user (if change is visible to the user)