Skip to content

Lock an encrypted space when it gets disabled - #3408

Merged
kulmann merged 1 commit into
mainfrom
fix/lock-vault-on-space-disable
Sep 18, 2026
Merged

kulmann merged 1 commit into
mainfrom
fix/lock-vault-on-space-disable

Conversation

@AlexAndBear

@AlexAndBear AlexAndBear commented Sep 18, 2026 •

Copy link
Copy Markdown
Member

Description

An unlocked encrypted space stayed unlocked after being disabled: the engine kept sitting in the vault store, so the space was still reported as unlocked while it could no longer be entered.

Disabling a space now locks it.

Related Issue

How Has This Been Tested?

  • test environment: local, pnpm test:unit --run (full suite: 451 files / 4128 tests passing), pnpm check:types, pnpm lint, pnpm format:check
  • test case 1: disabling a vault space clears its engine (clearEngine(spaceId, '/'))
  • test case 2: disabling several vault spaces at once locks every one of them
  • test case 3: disabling a space that is no vault space does not clear any engine
  • test case 4: disabling a space that merely holds vault folders (claim root /my.vault) does not clear any engine
  • test case 5: a space whose disable request failed is not locked
  • test case 6: the lock-vault action locks a vault space, shows the message and redirects out of the space
  • test case 7: the lock-vault action shows no message and does not redirect for a space that is no vault space, or for an empty selection
  • test case 8: verified the new tests fail when the lockSpaceVault call is removed from the disable handler

Types of changes

  • Bugfix
  • Enhancement (a change that doesn't break existing code or deployments)
  • Breaking change (a modification that affects current functionality)
  • Technical debt (addressing code that needs refactoring or improvements)
  • Tests (adding or improving tests)
  • Documentation (updates or additions to documentation)
  • Maintenance (like dependency updates or tooling adjustments)

@AlexAndBear AlexAndBear self-assigned this Sep 18, 2026
@AlexAndBear
AlexAndBear force-pushed the fix/lock-vault-on-space-disable branch from 6487e85 to 2a885f7 Compare September 18, 2026 09:25
A disabled space can no longer be entered, so leaving its engine in the
vault store only kept a stale key in memory and still reported the space
as unlocked. Disabling now locks it, reusing the `lockSpaceVault` helper
extracted from the lock-vault space action.

`lockSpaceVault` returns whether the space actually was a vault space, so
the lock-vault action keeps skipping its success message and its redirect
for a plain space.
@AlexAndBear
AlexAndBear force-pushed the fix/lock-vault-on-space-disable branch from 2a885f7 to 19d6285 Compare September 18, 2026 09:27
@AlexAndBear
AlexAndBear requested a review from kulmann September 18, 2026 09:29
@kulmann
kulmann merged commit 6153bbf into main Sep 18, 2026
31 checks passed
@kulmann
kulmann deleted the fix/lock-vault-on-space-disable branch September 18, 2026 10:40
@openclouders openclouders mentioned this pull request Sep 18, 2026
1 task
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Disabling a space doesn't auto-lock it

2 participants