diff --git a/app/static/js/vault.js b/app/static/js/vault.js index 77059a8..a910243 100644 --- a/app/static/js/vault.js +++ b/app/static/js/vault.js @@ -393,6 +393,10 @@ const Vault = (() => { * Returns an array suitable for the shared_updates field of PUT /api/vault/. */ async function buildSharedUpdates(itemId, plainData, itemName) { + // Ensure the owner's ECDH private key is loaded before attempting re-encryption. + // The session may not be ready yet if the user edits before loadSharedItemsForVault + // completes (async race on first load). + await ensureSharingSession(); if (!SharingSession.isReady()) return []; try { const res = await apiFetch("/api/sharing");