From b679bfe8f8146beb4d860de93c29a7d526a98076 Mon Sep 17 00:00:00 2001 From: Christian Byrne Date: Sat, 8 Nov 2025 09:19:12 -0800 Subject: [PATCH] logging: log context on session storage write error (QuotaError) (#6636) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit adds some context to the storage write errors observed in telemetry data - in order to pinpoint the exact cause. ┆Issue is synchronized with this [Notion page](https://www.notion.so/PR-6636-logging-log-context-on-session-storage-write-error-QuotaError-2a56d73d365081c28bb0dbfdfef8395a) by [Unito](https://www.unito.io) --- .../composables/useWorkflowPersistence.ts | 25 ++++++++++++++++--- 1 file changed, 22 insertions(+), 3 deletions(-) diff --git a/src/platform/workflow/persistence/composables/useWorkflowPersistence.ts b/src/platform/workflow/persistence/composables/useWorkflowPersistence.ts index f6f5f18280..ffe82e19f0 100644 --- a/src/platform/workflow/persistence/composables/useWorkflowPersistence.ts +++ b/src/platform/workflow/persistence/composables/useWorkflowPersistence.ts @@ -20,9 +20,28 @@ export function useWorkflowPersistence() { const persistCurrentWorkflow = () => { if (!workflowPersistenceEnabled.value) return const workflow = JSON.stringify(comfyApp.graph.serialize()) - localStorage.setItem('workflow', workflow) - if (api.clientId) { - sessionStorage.setItem(`workflow:${api.clientId}`, workflow) + + try { + localStorage.setItem('workflow', workflow) + if (api.clientId) { + sessionStorage.setItem(`workflow:${api.clientId}`, workflow) + } + } catch (error) { + // Only log our own keys and aggregate stats + const ourKeys = Object.keys(sessionStorage).filter( + (key) => key.startsWith('workflow:') || key === 'workflow' + ) + console.error('QuotaExceededError details:', { + workflowSizeKB: Math.round(workflow.length / 1024), + totalStorageItems: Object.keys(sessionStorage).length, + ourWorkflowKeys: ourKeys.length, + ourWorkflowSizes: ourKeys.map((key) => ({ + key, + sizeKB: Math.round(sessionStorage[key].length / 1024) + })), + error: error instanceof Error ? error.message : String(error) + }) + throw error } }