Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
34 commits
Select commit Hold shift + click to select a range
5c4f87b
fix: Replace reactive feature flags with non-reactive approach
viva-jinyi Sep 3, 2025
404585b
fix: Add HelpCenter manager state handling and API version switching
viva-jinyi Sep 3, 2025
f4fae6d
fix: Simplify manager state determination and fix API timing issues
viva-jinyi Sep 3, 2025
6d1d864
fix: Correct manager state determination for non-v4 servers
viva-jinyi Sep 3, 2025
13f156f
chore: Remove debug console.log statements
viva-jinyi Sep 3, 2025
775faa0
test: Update manager state store tests to match new logic
viva-jinyi Sep 3, 2025
6d8ed5c
fix: Remove dynamic API version handling in manager service
viva-jinyi Sep 4, 2025
896eb37
refactor: Add helper functions to managerStateStore for better code r…
viva-jinyi Sep 4, 2025
ad29891
fix: Ensure SystemStats is loaded before conflict detection
viva-jinyi Sep 4, 2025
5b6d6f1
docs: Clarify feature flag default behavior in manager state
viva-jinyi Sep 4, 2025
e5fb47f
fix: Ensure consistent manager state handling for legacy commands
viva-jinyi Sep 4, 2025
2df02e0
refactor: centralize manager opening logic into managerStateStore
viva-jinyi Sep 4, 2025
fe139af
fix: use correct i18n import in managerStateStore
viva-jinyi Sep 4, 2025
abeed2e
feature: initial tab fix
viva-jinyi Sep 4, 2025
4603ca3
test: Fix managerStateStore test failures by adding missing mocks
viva-jinyi Sep 4, 2025
5de7788
refactor: convert managerStateStore to composable
viva-jinyi Sep 5, 2025
4098d34
refactor: use readonly computed properties instead of getter methods
viva-jinyi Sep 5, 2025
dd17988
fix: check isManagerEnabled check to GraphCanvas.vue to avoid the sid…
viva-jinyi Sep 5, 2025
61058a8
chore: console.log to console.debug
viva-jinyi Sep 5, 2025
1bdc990
chore: useConflictDetection().initializeConflictDetection()
viva-jinyi Sep 5, 2025
2386dec
test: add mockManagerDisabled option to disable manager in Playwright…
viva-jinyi Sep 5, 2025
aef2b7b
chore: text modified
viva-jinyi Sep 5, 2025
2cadf05
fix: resolve CI/CD failures by fixing manager initialization timing
viva-jinyi Sep 5, 2025
91c6c87
chore: modified the note
viva-jinyi Sep 5, 2025
75db082
fix: test code modified
viva-jinyi Sep 5, 2025
2b42259
fix: when manager is new manager ui, conflict detectetion should work
viva-jinyi Sep 5, 2025
9634186
fix: ensure fetch system stats before determine manager stats & when …
viva-jinyi Sep 6, 2025
ecbb78d
chore: unnecessary .value deleted & fetch name modified to refetch
viva-jinyi Sep 6, 2025
647a0f2
fix: ref type .value needed
viva-jinyi Sep 6, 2025
c9dd3de
chore: vue use until pattern for waiting initializing
viva-jinyi Sep 6, 2025
3f2ccd8
fix: .value added
viva-jinyi Sep 6, 2025
a363cdc
fix: useManagerState test to properly mock reactive refs
viva-jinyi Sep 6, 2025
1974b1f
fix: when system stats initialized, use until(systemStatsStore.isInit…
viva-jinyi Sep 6, 2025
eda2bf9
fix: test
viva-jinyi Sep 6, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
chore: unnecessary .value deleted & fetch name modified to refetch
  • Loading branch information
viva-jinyi committed Sep 6, 2025
commit ecbb78d09b2b36f5b5b183a3cb7ad6eba3008508
2 changes: 1 addition & 1 deletion src/components/dialog/content/ErrorDialogContent.vue
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ const showContactSupport = async () => {

onMounted(async () => {
if (!systemStatsStore.systemStats) {
await systemStatsStore.fetchSystemStats()
await systemStatsStore.refetchSystemStats()
}

try {
Expand Down
4 changes: 2 additions & 2 deletions src/components/dialog/content/LoadWorkflowWarning.vue
Original file line number Diff line number Diff line change
Expand Up @@ -107,12 +107,12 @@ const uniqueNodes = computed(() => {

// Show manager buttons unless manager is disabled
const showManagerButtons = computed(() => {
return managerState.shouldShowManagerButtons.value
return managerState.shouldShowManagerButtons
})

// Only show Install All button for NEW_UI (new manager with v4 support)
const showInstallAllButton = computed(() => {
return managerState.shouldShowInstallButton.value
return managerState.shouldShowInstallButton
})

const openManager = async () => {
Expand Down
2 changes: 1 addition & 1 deletion src/composables/nodePack/useWorkflowPacks.ts
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ export const useWorkflowPacks = (options: UseNodePacksOptions = {}) => {
const nodeDef = nodeDefStore.nodeDefsByName[nodeName]
if (nodeDef?.nodeSource.type === 'core') {
if (!systemStatsStore.systemStats) {
await systemStatsStore.fetchSystemStats()
await systemStatsStore.refetchSystemStats()
}
return {
id: CORE_NODES_PACK_NAME,
Expand Down
2 changes: 1 addition & 1 deletion src/composables/useConflictDetection.ts
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ export function useConflictDetection() {
const systemStatsStore = useSystemStatsStore()
// Wait for systemStats to be initialized if not already
if (!systemStatsStore.isInitialized) {
await systemStatsStore.fetchSystemStats()
await systemStatsStore.refetchSystemStats()
}

// Fetch version information from backend (with error resilience)
Expand Down
2 changes: 1 addition & 1 deletion src/stores/releaseStore.ts
Original file line number Diff line number Diff line change
Expand Up @@ -240,7 +240,7 @@ export const useReleaseStore = defineStore('release', () => {
try {
// Ensure system stats are loaded
if (!systemStatsStore.systemStats) {
await systemStatsStore.fetchSystemStats()
await systemStatsStore.refetchSystemStats()
}

const fetchedReleases = await releaseService.getReleases({
Expand Down
4 changes: 2 additions & 2 deletions src/stores/systemStatsStore.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ export const useSystemStatsStore = defineStore('systemStats', () => {
isLoading,
error,
isReady: isInitialized,
execute: fetchSystemStats
execute: refetchSystemStats
} = useAsyncState<SystemStats | null>(
fetchSystemStatsData,
null, // initial value
Expand Down Expand Up @@ -65,7 +65,7 @@ export const useSystemStatsStore = defineStore('systemStats', () => {
isLoading,
error,
isInitialized,
fetchSystemStats,
refetchSystemStats,
getFormFactor
}
})
2 changes: 1 addition & 1 deletion src/stores/versionCompatibilityStore.ts
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ export const useVersionCompatibilityStore = defineStore(

async function checkVersionCompatibility() {
if (!systemStatsStore.systemStats) {
await systemStatsStore.fetchSystemStats()
await systemStatsStore.refetchSystemStats()
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,14 +33,14 @@ const createMockNode = (type: string, version?: string): LGraphNode =>
describe('MissingCoreNodesMessage', () => {
const mockSystemStatsStore = {
systemStats: null as { system?: { comfyui_version?: string } } | null,
fetchSystemStats: vi.fn()
refetchSystemStats: vi.fn()
}

beforeEach(() => {
vi.clearAllMocks()
// Reset the mock store state
mockSystemStatsStore.systemStats = null
mockSystemStatsStore.fetchSystemStats = vi.fn()
mockSystemStatsStore.refetchSystemStats = vi.fn()
// @ts-expect-error - Mocking the return value of useSystemStatsStore for testing.
// The actual store has more properties, but we only need these for our tests.
useSystemStatsStore.mockReturnValue(mockSystemStatsStore)
Expand Down
10 changes: 5 additions & 5 deletions tests-ui/tests/composables/useConflictDetection.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ describe.skip('useConflictDetection with Registry Store', () => {
}

const mockSystemStatsStore = {
fetchSystemStats: vi.fn(),
refetchSystemStats: vi.fn(),
systemStats: {
system: {
comfyui_version: '0.3.41',
Expand Down Expand Up @@ -133,7 +133,7 @@ describe.skip('useConflictDetection with Registry Store', () => {
} as any

// Reset mock functions
mockSystemStatsStore.fetchSystemStats.mockResolvedValue(undefined)
mockSystemStatsStore.refetchSystemStats.mockResolvedValue(undefined)
mockComfyManagerService.listInstalledPacks.mockReset()
mockComfyManagerService.getImportFailInfo.mockReset()
mockRegistryService.getPackByVersion.mockReset()
Expand Down Expand Up @@ -185,7 +185,7 @@ describe.skip('useConflictDetection with Registry Store', () => {

it('should return fallback environment information when systemStatsStore fails', async () => {
// Mock systemStatsStore failure
mockSystemStatsStore.fetchSystemStats.mockRejectedValue(
mockSystemStatsStore.refetchSystemStats.mockRejectedValue(
new Error('Store failure')
)
mockSystemStatsStore.systemStats = null
Expand Down Expand Up @@ -754,7 +754,7 @@ describe.skip('useConflictDetection with Registry Store', () => {
describe('error resilience with Registry Store', () => {
it('should continue execution even when system environment detection fails', async () => {
// Mock system stats store failure
mockSystemStatsStore.fetchSystemStats.mockRejectedValue(
mockSystemStatsStore.refetchSystemStats.mockRejectedValue(
new Error('Store error')
)
mockSystemStatsStore.systemStats = null
Expand Down Expand Up @@ -851,7 +851,7 @@ describe.skip('useConflictDetection with Registry Store', () => {

it('should handle complete system failure gracefully', async () => {
// Mock all stores/services failing
mockSystemStatsStore.fetchSystemStats.mockRejectedValue(
mockSystemStatsStore.refetchSystemStats.mockRejectedValue(
new Error('Critical error')
)
mockSystemStatsStore.systemStats = null
Expand Down
4 changes: 2 additions & 2 deletions tests-ui/tests/composables/useManagerState.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -296,7 +296,7 @@ describe('useManagerState', () => {
} as any)

const managerState = useManagerState()
expect(managerState.shouldShowInstallButton.value).toBe(true)
expect(managerState.shouldShowInstallButton).toBe(true)
})

it('shouldShowManagerButtons should return true when not DISABLED', () => {
Expand All @@ -313,7 +313,7 @@ describe('useManagerState', () => {
} as any)

const managerState = useManagerState()
expect(managerState.shouldShowManagerButtons.value).toBe(true)
expect(managerState.shouldShowManagerButtons).toBe(true)
})
})
})
8 changes: 4 additions & 4 deletions tests-ui/tests/store/releaseStore.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ describe('useReleaseStore', () => {
comfyui_version: '1.0.0'
}
},
fetchSystemStats: vi.fn(),
refetchSystemStats: vi.fn(),
getFormFactor: vi.fn(() => 'git-windows')
}

Expand Down Expand Up @@ -339,7 +339,7 @@ describe('useReleaseStore', () => {

await store.initialize()

expect(mockSystemStatsStore.fetchSystemStats).toHaveBeenCalled()
expect(mockSystemStatsStore.refetchSystemStats).toHaveBeenCalled()
})

it('should not set loading state when notifications disabled', async () => {
Expand Down Expand Up @@ -406,7 +406,7 @@ describe('useReleaseStore', () => {

await store.fetchReleases()

expect(mockSystemStatsStore.fetchSystemStats).toHaveBeenCalled()
expect(mockSystemStatsStore.refetchSystemStats).toHaveBeenCalled()
expect(mockReleaseService.getReleases).toHaveBeenCalled()
})
})
Expand Down Expand Up @@ -530,7 +530,7 @@ describe('useReleaseStore', () => {
await store.initialize()

// Should not fetch system stats when notifications disabled
expect(mockSystemStatsStore.fetchSystemStats).not.toHaveBeenCalled()
expect(mockSystemStatsStore.refetchSystemStats).not.toHaveBeenCalled()
})

it('should handle concurrent fetchReleases calls', async () => {
Expand Down
12 changes: 6 additions & 6 deletions tests-ui/tests/store/systemStatsStore.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ describe('useSystemStatsStore', () => {
expect(store.isInitialized).toBe(true) // Should be initialized after fetch
})

describe('fetchSystemStats', () => {
describe('refetchSystemStats', () => {
it('should fetch system stats successfully', async () => {
const mockStats = {
system: {
Expand All @@ -58,7 +58,7 @@ describe('useSystemStatsStore', () => {

vi.mocked(api.getSystemStats).mockResolvedValue(mockStats)

await store.fetchSystemStats()
await store.refetchSystemStats()

expect(store.systemStats).toEqual(mockStats)
expect(store.isLoading).toBe(false)
Expand All @@ -71,7 +71,7 @@ describe('useSystemStatsStore', () => {
const error = new Error('API Error')
vi.mocked(api.getSystemStats).mockRejectedValue(error)

await store.fetchSystemStats()
await store.refetchSystemStats()

expect(store.systemStats).toBeNull() // Initial value stays null on error
expect(store.isLoading).toBe(false)
Expand All @@ -81,7 +81,7 @@ describe('useSystemStatsStore', () => {
it('should handle non-Error objects', async () => {
vi.mocked(api.getSystemStats).mockRejectedValue('String error')

await store.fetchSystemStats()
await store.refetchSystemStats()

expect(store.error).toBe('String error') // useAsyncState stores the actual error
})
Expand All @@ -93,7 +93,7 @@ describe('useSystemStatsStore', () => {
})
vi.mocked(api.getSystemStats).mockReturnValue(promise)

const fetchPromise = store.fetchSystemStats()
const fetchPromise = store.refetchSystemStats()
expect(store.isLoading).toBe(true)

resolvePromise({})
Expand All @@ -120,7 +120,7 @@ describe('useSystemStatsStore', () => {

vi.mocked(api.getSystemStats).mockResolvedValue(updatedStats)

await store.fetchSystemStats()
await store.refetchSystemStats()

expect(store.systemStats).toEqual(updatedStats)
expect(store.isLoading).toBe(false)
Expand Down
6 changes: 3 additions & 3 deletions tests-ui/tests/store/versionCompatibilityStore.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ describe('useVersionCompatibilityStore', () => {

mockSystemStatsStore = {
systemStats: null,
fetchSystemStats: vi.fn()
refetchSystemStats: vi.fn()
}

vi.mocked(useSystemStatsStore).mockReturnValue(mockSystemStatsStore)
Expand Down Expand Up @@ -302,7 +302,7 @@ describe('useVersionCompatibilityStore', () => {

await store.initialize()

expect(mockSystemStatsStore.fetchSystemStats).toHaveBeenCalled()
expect(mockSystemStatsStore.refetchSystemStats).toHaveBeenCalled()
})

it('should not fetch system stats if already available', async () => {
Expand All @@ -315,7 +315,7 @@ describe('useVersionCompatibilityStore', () => {

await store.initialize()

expect(mockSystemStatsStore.fetchSystemStats).not.toHaveBeenCalled()
expect(mockSystemStatsStore.refetchSystemStats).not.toHaveBeenCalled()
})
})
})