Skip to content

Let providers report when a mount terminates - #105

Merged
infeo merged 2 commits into
developfrom
feature/mount-when-terminated
Oct 12, 2026
Merged

infeo merged 2 commits into
developfrom
feature/mount-when-terminated

Conversation

@tobihagemann

Copy link
Copy Markdown
Member

Adds Mount#whenTerminated() and MountCapability.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, umount from 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_TERMINATED only 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.

Copilot AI balanced review requested due to automatic review settings October 9, 2026 09:09
@coderabbitai

coderabbitai Bot commented Oct 9, 2026 •

Copy link
Copy Markdown

Review in Change Stack →

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration
  • Configuration used: Organization UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: c07f1e30-42bc-4247-82cb-5c3adc28dd39

📥 Commits

Reviewing files that changed from the base of the PR and between 3c61b3f and 4abee24.


📒 Files selected for processing (3)
  • CHANGELOG.md
  • src/main/java/org/cryptomator/integrations/mount/Mount.java
  • src/main/java/org/cryptomator/integrations/mount/MountCapability.java

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

Mount adds a default whenTerminated() method that returns a CompletionStage<Void> and throws UnsupportedOperationException by default. The WHEN_TERMINATED capability identifies providers that support the method. The method documentation states that its stage completes normally when the mount ends for any reason and that close() remains necessary for resource cleanup. The Unreleased changelog describes these additions.

Priority: ➖ Normal

Estimated code review effort: 2 (Simple) | ~10 minutes

Change: Feature

Suggested reviewers: infeo

Merge Risk: ⚪ Minimal · up to 4abee

No actionable merge-blocking risk is identified; the change is mergeable after normal checks.

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description check Passed The description clearly explains the new Mount#whenTerminated() API, the WHEN_TERMINATED capability, the termination scenarios, and the safety objective.
Title check Passed The title is concise, specific, and accurately summarizes the main change: providers can report mount termination.
Docstring Coverage Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 2 functions across 2 files. (1 skipped: 1 …
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.


✨ Finishing Touches
📝 Generate docstrings
  • Commit to this branch
  • Create a new PR

🧪 Generate unit tests (beta)
  • Commit to this branch
  • Create a new PR


  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 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.

@tobihagemann
tobihagemann requested a review from infeo October 9, 2026 09:21

@infeo infeo left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A CompletionStage looks a tad much, but it suffices as an on-event-trigger

@infeo infeo self-assigned this Oct 12, 2026
@infeo
infeo merged commit 7fd3f6c into develop Oct 12, 2026
13 checks passed
@infeo
infeo deleted the feature/mount-when-terminated branch October 12, 2026 21:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants