Conversation
🎨 Storybook Build Status✅ Build completed successfully! ⏰ Completed at: 01/27/2026, 09:48:54 PM UTC 🔗 Links🎉 Your Storybook is ready for review! |
📝 WalkthroughWalkthroughThe bootstrap initialization was refactored to centralize authenticated store loading. A Changes
Sequence Diagram(s)mermaid ✨ Finishing touches
Comment |
🎭 Playwright Tests:
|
Bundle Size ReportSummary
Category Glance Per-category breakdownApp Entry Points — 23.6 kB (baseline 23.6 kB) • ⚪ 0 BMain entry bundles and manifests
Status: 1 added / 1 removed Graph Workspace — 960 kB (baseline 960 kB) • ⚪ 0 BGraph editor runtime, canvas, workflow orchestration
Status: 1 added / 1 removed Views & Navigation — 80.7 kB (baseline 80.7 kB) • ⚪ 0 BTop-level views, pages, and routed surfaces
Status: 9 added / 9 removed Panels & Settings — 470 kB (baseline 470 kB) • 🟢 -8 BConfiguration panels, inspectors, and settings screens
Status: 12 added / 12 removed User & Accounts — 3.94 kB (baseline 3.94 kB) • ⚪ 0 BAuthentication, profile, and account management bundles
Status: 3 added / 3 removed Editors & Dialogs — 2.9 kB (baseline 2.9 kB) • ⚪ 0 BModals, dialogs, drawers, and in-app editors
Status: 2 added / 2 removed UI Components — 33.7 kB (baseline 33.7 kB) • ⚪ 0 BReusable component library chunks
Status: 4 added / 4 removed Data & Services — 2.7 MB (baseline 2.7 MB) • 🔴 +205 BStores, services, APIs, and repositories
Status: 9 added / 9 removed Utilities & Hooks — 25.5 kB (baseline 25.5 kB) • ⚪ 0 BHelpers, composables, and utility bundles
Status: 7 added / 7 removed Vendor & Third-Party — 10.7 MB (baseline 10.7 MB) • ⚪ 0 BExternal libraries and shared vendor chunks
Other — 7.04 MB (baseline 7.04 MB) • 🟢 -200 BBundles that do not match a named category
Status: 37 added / 37 removed |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Fix all issues with AI agents
In `@src/stores/bootstrapStore.ts`:
- Around line 47-51: Add explicit timeouts to the blocking until(...) calls:
change the Firebase auth initialization wait (the until(...).toBe(...) used in
cloud mode) and the await until(needsLogin).toBe(false) to include a timeout
option (e.g., { timeout: 16_000 }) and wrap each await in try/catch so a timeout
doesn't indefinitely block startup; in the catch log a clear error/warning and
allow execution to continue so functions like loadI18n() and
loadAuthenticatedStores() still run.
| const { needsLogin } = storeToRefs(userStore) | ||
| await until(needsLogin).toBe(false) | ||
|
|
||
| if (!userStore.needsLogin) { | ||
| void settingStore.load() | ||
| void workflowStore.loadWorkflows() | ||
| } | ||
| void loadI18n() | ||
| loadAuthenticatedStores() |
There was a problem hiding this comment.
🧩 Analysis chain
🏁 Script executed:
#!/bin/bash
# First, get the repository structure overview
echo "=== Repository structure ==="
find . -type f -name "*.ts" -path "*store*" | grep -E "(bootstrap|user)" | head -20
echo ""
echo "=== Check bootstrapStore.ts content ==="
cat -n src/stores/bootstrapStore.ts | head -80Repository: Comfy-Org/ComfyUI_frontend
Length of output: 2313
🏁 Script executed:
#!/bin/bash
# Check userStore implementation
echo "=== Check userStore.ts for needsLogin ==="
fd "userStore.ts$" --exec cat -n {} \;
echo ""
echo "=== Search for needsLogin usage pattern ==="
rg "needsLogin" -n -C3 --type tsRepository: Comfy-Org/ComfyUI_frontend
Length of output: 5395
🏁 Script executed:
#!/bin/bash
# Check how startStoreBootstrap is called and used
echo "=== Check startStoreBootstrap usage ==="
rg "startStoreBootstrap" -n -B2 -A2 --type ts --type vue
echo ""
echo "=== Check if bootstrap completion is awaited in App.vue or main.ts ==="
rg -n "bootstrap|isI18nReady|needsLogin" src/App.vue src/main.ts --type vue --type ts 2>/dev/null | head -30Repository: Comfy-Org/ComfyUI_frontend
Length of output: 226
🏁 Script executed:
#!/bin/bash
# Check if there's a timeout mechanism in the bootstrap flow
echo "=== Search for timeout in bootstrap or until usage ==="
rg "until.*toBe|timeout|abortSignal" -n --type ts | grep -E "(bootstrap|until|timeout)"
echo ""
echo "=== Check the 'until' function import ==="
rg "import.*until" -n --type tsRepository: Comfy-Org/ComfyUI_frontend
Length of output: 15501
🏁 Script executed:
#!/bin/bash
# Understand the user authentication flow
echo "=== Check user initialization and login flow ==="
rg "initialize|needsLogin.*true|needsLogin.*false|setNeedsLogin" -n -C2 --type ts | head -50Repository: Comfy-Org/ComfyUI_frontend
Length of output: 4777
🏁 Script executed:
#!/bin/bash
# Search for startStoreBootstrap invocation
echo "=== Searching for startStoreBootstrap calls ==="
rg "startStoreBootstrap" -n --type ts --type vue
echo ""
echo "=== Check App initialization in main files ==="
fd -e ts -e vue "main\.(ts|vue)$|App\.(ts|vue)$" | head -10 | xargs -I {} bash -c 'echo "=== {} ===" && head -50 {}'Repository: Comfy-Org/ComfyUI_frontend
Length of output: 4777
🏁 Script executed:
#!/bin/bash
# Check if bootstrap is awaited at application startup
echo "=== Search for bootstrap in entry points ==="
find . -name "main.ts" -o -name "main.js" | xargs cat 2>/dev/null | head -100
echo ""
echo "=== Check vite.config or entry points ==="
find . \( -name "vite.config.*" -o -name "tsconfig.json" \) -exec grep -l "entry\|src/main" {} \;Repository: Comfy-Org/ComfyUI_frontend
Length of output: 3380
🏁 Script executed:
#!/bin/bash
# Look at App.vue setup
echo "=== Check App.vue or root component ==="
find src -name "App.vue" -o -name "App.ts" | xargs cat 2>/dev/null | head -100Repository: Comfy-Org/ComfyUI_frontend
Length of output: 2133
🏁 Script executed:
#!/bin/bash
# Search for router guards and how bootstrap is used
echo "=== Check router.ts for bootstrap usage ==="
cat -n src/router.ts | head -200
echo ""
echo "=== Search specifically for bootstrap in router ==="
rg "bootstrap|startStoreBootstrap" src/router.ts -n -A3 -B3Repository: Comfy-Org/ComfyUI_frontend
Length of output: 7292
🏁 Script executed:
#!/bin/bash
# Check if bootstrap is called in beforeEach or other router hooks
echo "=== Full router.ts ==="
wc -l src/router.ts && echo "File is large, checking structure..." && grep -n "beforeEach\|startStoreBootstrap\|Bootstrap" src/router.tsRepository: Comfy-Org/ComfyUI_frontend
Length of output: 200
🏁 Script executed:
#!/bin/bash
# Get full main.ts content
echo "=== Full main.ts content ==="
cat -n src/main.tsRepository: Comfy-Org/ComfyUI_frontend
Length of output: 3541
🏁 Script executed:
#!/bin/bash
# Search more broadly for useBootstrapStore usage
echo "=== Search for useBootstrapStore usage ==="
rg "useBootstrapStore" -n --type ts
echo ""
echo "=== Check if bootstrap is referenced anywhere ==="
rg "startStoreBootstrap|useBootstrapStore" -r . --type tsRepository: Comfy-Org/ComfyUI_frontend
Length of output: 1386
🏁 Script executed:
#!/bin/bash
# Verify the until function signature and confirm no default timeout
echo "=== Check VueUse documentation for until() ==="
rg "from '@vueuse/core'" -A5 src/router.ts src/stores/bootstrapStore.ts
echo ""
echo "=== Check if there's any error handling around the until() call ==="
cat -n src/stores/bootstrapStore.ts | sed -n '38,52p'Repository: Comfy-Org/ComfyUI_frontend
Length of output: 1399
Add timeout to until(needsLogin).toBe(false) to prevent indefinite blocking.
The await until(needsLogin).toBe(false) on line 48 lacks a timeout and will hang indefinitely if the user is on a multi-user server and hasn't logged in yet (making needsLogin remain true). This blocks loadI18n() and loadAuthenticatedStores() from completing.
Add a timeout parameter matching the pattern used in src/router.ts:141:
await until(needsLogin).toBe(false, { timeout: 16_000 })
The same issue exists on line 44 for Firebase auth initialization in cloud mode—both until() calls should have explicit timeouts with appropriate error handling.
🤖 Prompt for AI Agents
In `@src/stores/bootstrapStore.ts` around lines 47 - 51, Add explicit timeouts to
the blocking until(...) calls: change the Firebase auth initialization wait (the
until(...).toBe(...) used in cloud mode) and the await
until(needsLogin).toBe(false) to include a timeout option (e.g., { timeout:
16_000 }) and wrap each await in try/catch so a timeout doesn't indefinitely
block startup; in the catch log a clear error/warning and allow execution to
continue so functions like loadI18n() and loadAuthenticatedStores() still run.
Amp-Thread-ID: https://ampcode.com/threads/T-019c016a-baa6-7127-87d4-6fa48ff4de74 Co-authored-by: Amp <amp@ampcode.com>
There was a problem hiding this comment.
Actionable comments posted: 0
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
src/stores/bootstrapStore.test.ts (1)
45-70: Hoist mock state viavi.hoisted()to avoid module-level mutable refs invi.mockfactories.
mockNeedsLogin,mockIsSettingsReady, andmockIsFirebaseInitializedare all module-level refs referenced directly invi.mockfactories, creating hoisting pitfalls. Extract all three intovi.hoisted()containers for safer per-test state management, consistent with the pattern already used formockDistributionTypes.♻️ Proposed refactor
-const mockIsSettingsReady = ref(false) - +const mockSettingsState = vi.hoisted(() => ({ + isReady: ref(false) +})) vi.mock('@/platform/settings/settingStore', () => ({ useSettingStore: vi.fn(() => ({ load: vi.fn(() => { - mockIsSettingsReady.value = true + mockSettingsState.isReady.value = true }), get isReady() { - return mockIsSettingsReady.value + return mockSettingsState.isReady.value }, isLoading: ref(false), error: ref(undefined) })) })) -const mockNeedsLogin = ref(false) +const mockUserState = vi.hoisted(() => ({ + needsLogin: ref(false) +})) vi.mock('@/stores/userStore', () => ({ useUserStore: vi.fn(() => ({ initialize: vi.fn().mockResolvedValue(undefined), - needsLogin: mockNeedsLogin + needsLogin: mockUserState.needsLogin })) })) -const mockIsFirebaseInitialized = ref(false) +const mockFirebaseState = vi.hoisted(() => ({ + isInitialized: ref(false) +})) vi.mock('@/stores/firebaseAuthStore', () => ({ useFirebaseAuthStore: vi.fn(() => ({ - isInitialized: mockIsFirebaseInitialized + isInitialized: mockFirebaseState.isInitialized })) })) describe('bootstrapStore', () => { beforeEach(() => { - mockIsSettingsReady.value = false - mockIsFirebaseInitialized.value = false - mockNeedsLogin.value = false + mockSettingsState.isReady.value = false + mockFirebaseState.isInitialized.value = false + mockUserState.needsLogin.value = false mockDistributionTypes.isCloud = false setActivePinia(createTestingPinia({ stubActions: false })) vi.clearAllMocks() })
| { immediate: false } | ||
| ) | ||
|
|
||
| let storesLoaded = false |
Move nodeReplacementStore.load() to bootstrapStore for parallel initialization and await isLoaded at consumption point using reactive wait, aligned with #8340 bootstrap architecture.
Summary
Add additional protection for bootstrap order issues.
┆Issue is synchronized with this Notion page by Unito