Repository navigation
Let providers report when a mount terminates - #105
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configuration
📒 Files selected for processing (3)
Included review availability: This review used your included allowance. Your plan provides up to 1 included review per hour; 0 remain after this review. Walkthrough
Priority: ➖ Normal Estimated code review effort: 2 (Simple) | ~10 minutes Change: Feature Suggested reviewers: Merge Risk: ⚪ Minimal · up to No actionable merge-blocking risk is identified; the change is mergeable after normal checks. 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)✨ Finishing Touches📝 Generate docstrings
🧪 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.
🟢 Approval recommended
The API contract is clear, backward-compatible, and consistently follows existing capability patterns.
0 open findings
What changed in this PR
Adds a backward-compatible mount termination notification API.
Changes:
- Adds
Mount.whenTerminated()and its capability flag. - Documents the API addition in the changelog.
| File | Description |
|---|---|
Mount.java |
Defines the termination notification contract. |
MountCapability.java |
Adds WHEN_TERMINATED. |
CHANGELOG.md |
Records the new API. |
🧠 Review effort: Balanced
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
infeo
left a comment
There was a problem hiding this comment.
A CompletionStage looks a tad much, but it suffices as an on-event-trigger
Adds
Mount#whenTerminated()andMountCapability.WHEN_TERMINATED, so a provider can report to Cryptomator when a mount terminates, whether it was unmounted through the API or not (ejected in Finder,umountfrom a shell, the process serving it died).On macOS, FSKit and FUSE-T mount onto an existing directory. If such a mount terminates while the vault stays unlocked, the mount point is a plain directory again and anything written there lands unencrypted on the local disk. So far a provider has no way to report that, so Cryptomator can't react by locking the vault.
A provider declares
WHEN_TERMINATEDonly if it notices every termination of its mounts, so Cryptomator can rely on it.whenTerminated()also completes when Cryptomator itself unmounts, so Cryptomator has to ignore terminations it caused. Existing providers keep working without changes.