File tree Expand file tree Collapse file tree 1 file changed +22
-3
lines changed
src/platform/workflow/persistence/composables Expand file tree Collapse file tree 1 file changed +22
-3
lines changed Original file line number Diff line number Diff line change @@ -20,9 +20,28 @@ export function useWorkflowPersistence() {
2020 const persistCurrentWorkflow = ( ) => {
2121 if ( ! workflowPersistenceEnabled . value ) return
2222 const workflow = JSON . stringify ( comfyApp . graph . serialize ( ) )
23- localStorage . setItem ( 'workflow' , workflow )
24- if ( api . clientId ) {
25- sessionStorage . setItem ( `workflow:${ api . clientId } ` , workflow )
23+
24+ try {
25+ localStorage . setItem ( 'workflow' , workflow )
26+ if ( api . clientId ) {
27+ sessionStorage . setItem ( `workflow:${ api . clientId } ` , workflow )
28+ }
29+ } catch ( error ) {
30+ // Only log our own keys and aggregate stats
31+ const ourKeys = Object . keys ( sessionStorage ) . filter (
32+ ( key ) => key . startsWith ( 'workflow:' ) || key === 'workflow'
33+ )
34+ console . error ( 'QuotaExceededError details:' , {
35+ workflowSizeKB : Math . round ( workflow . length / 1024 ) ,
36+ totalStorageItems : Object . keys ( sessionStorage ) . length ,
37+ ourWorkflowKeys : ourKeys . length ,
38+ ourWorkflowSizes : ourKeys . map ( ( key ) => ( {
39+ key,
40+ sizeKB : Math . round ( sessionStorage [ key ] . length / 1024 )
41+ } ) ) ,
42+ error : error instanceof Error ? error . message : String ( error )
43+ } )
44+ throw error
2645 }
2746 }
2847
You can’t perform that action at this time.
0 commit comments