From b614b63ead952062e161d1ae08b1fca6c4b119a7 Mon Sep 17 00:00:00 2001 From: NguyenND Date: Fri, 29 May 2026 14:05:58 -0400 Subject: [PATCH] 05/29 Update shared items displayed on Grantee items 3 --- app/static/js/vault.js | 4 ++++ 1 file changed, 4 insertions(+) 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");