Skip to content

fix: re-root unlocked vault engines when a vault or its parent folder is renamed - #3964

Merged
AlexAndBear merged 2 commits into
mainfrom
fix/vault-rename-engine-root
Oct 21, 2026
Merged

AlexAndBear merged 2 commits into
mainfrom
fix/vault-rename-engine-root

Conversation

@AlexAndBear

Copy link
Copy Markdown
Member

Description

  • Re-root on rename: moveEngine re-filed the unlocked engine under the new key but left engine.vaultRoot on the old path, so the path helpers still mapped to the old location (404 on open, ciphertext names, uploads to the old path). It now updates the root too, keeping the engine and its key, so no re-unlock is needed.
  • Parent folder renames: engines of vaults inside a renamed folder move along, so they stay unlocked. Rename now always calls moveEngine (it does nothing when no vault is unlocked there).
  • Space and share roots untouched: engines rooted at / (vault spaces, share-rooted vaults) are never moved; a space rename doesn't change the engine key anyway.
  • Docs: the vaultRoot comments said it's only used for identity, which wasn't true.

Not part of this: moving (not renaming) a parent folder that holds an unlocked vault still leaves a stale engine under the old key; that was the same before and is a separate follow-up.

Related Issue

How Has This Been Tested?

  • test environment: unit tests (Vitest), browser tests (Playwright) against a local OpenCloud
  • test case 1: unit: moveEngine re-roots for shorter, same-length and longer names (checked through encryptVaultPath/decryptVaultPath), vaults inside a renamed folder move, siblings and other spaces stay, /-rooted engines stay; rename calls moveEngine
  • test case 2: browser: reproduced on main (unlock page for the old name + rejected password, ciphertext names, 412 uploads), fixed on this branch for shorter/same-length/longer renames incl. upload, folder, rename and delete inside; reload + unlock, parent folder rename, rename from inside, rename inside the vault, dropping and restoring .vault, lock and delete; vault space rename stays unlocked

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 merged commit 61c1c83 into main Oct 21, 2026
27 checks passed
@AlexAndBear
AlexAndBear deleted the fix/vault-rename-engine-root branch October 21, 2026 14:51
@openclouders openclouders mentioned this pull request Oct 21, 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.

After renaming an unlocked vault, it can't be opened and the correct password is rejected

2 participants