Handle prompt on unlocking the keyring#157
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
Walkthrough
Estimated code review effort: 2 (Simple) | ~8 minutes Possibly related PRs
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🧹 Nitpick comments (1)
src/main/java/org/cryptomator/linux/keychain/SecretServiceKeychainAccess.java (1)
57-60: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick winAdd coverage for the locked-keyring prompt path.
The existing functional tests are guarded by
!service.isLocked(), so they never exercise the newneedLock.getPath() != "/"branch. Add a test that verifies the prompt is handled before item creation.🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@src/main/java/org/cryptomator/linux/keychain/SecretServiceKeychainAccess.java` around lines 57 - 60, Add functional-test coverage for the branch in the session unlock flow that calls Util.promptAndGetResultAsArrayList when needLock.getPath() is not "/". Configure the test service/keyring as locked, verify the prompt is handled, and assert this occurs before the item is created, while preserving existing tests for unlocked services.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In
`@src/main/java/org/cryptomator/linux/keychain/SecretServiceKeychainAccess.java`:
- Around line 57-60: Update the unlock handling in SecretServiceKeychainAccess
so the result of session.getService().unlock(lockable) is checked with
isSuccess() before accessing value().b; when unsuccessful, surface the
underlying unlock.error() and avoid passing an invalid value to
Util.promptAndGetResultAsArrayList.
---
Nitpick comments:
In
`@src/main/java/org/cryptomator/linux/keychain/SecretServiceKeychainAccess.java`:
- Around line 57-60: Add functional-test coverage for the branch in the session
unlock flow that calls Util.promptAndGetResultAsArrayList when
needLock.getPath() is not "/". Configure the test service/keyring as locked,
verify the prompt is handled, and assert this occurs before the item is created,
while preserving existing tests for unlocked services.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: ce13a441-bfe6-4c3d-9e12-f8fa91562226
📒 Files selected for processing (1)
src/main/java/org/cryptomator/linux/keychain/SecretServiceKeychainAccess.java
Co-authored-by: coderabbitai
Fixes #156