Skip to content
Merged
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
fix: Remove dynamic API version handling in manager service
- Remove getApiBaseURL() function and axios interceptor
- Always use /api/v2/ for New Manager (hardcoded)
- Add isManagerServiceAvailable() to block service calls when not in NEW_UI state
- Simplify API handling as manager packages are now completely separated
  • Loading branch information
viva-jinyi committed Sep 6, 2025
commit 6d8ed5c68cf14a1d189496c5eb184e55a9959623
31 changes: 15 additions & 16 deletions src/services/comfyManagerService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,36 +38,29 @@ enum ManagerRoute {
QUEUE_TASK = 'manager/queue/task'
}

// Dynamically determine API version based on manager state
const getApiBaseURL = () => {
const managerStore = useManagerStateStore()
const state = managerStore.getManagerUIState()

// Use v2 API only for NEW_UI state
const apiPrefix = state === ManagerUIState.NEW_UI ? '/v2/' : '/'
return api.apiURL(apiPrefix)
}

// Always use v2 API for New Manager (no dynamic switching needed)
const managerApiClient = axios.create({
baseURL: api.apiURL('/v2/'),
headers: {
'Content-Type': 'application/json'
}
})

// Add request interceptor to dynamically set baseURL
managerApiClient.interceptors.request.use((config) => {
config.baseURL = getApiBaseURL()
return config
})

/**
* Service for interacting with the ComfyUI Manager API
* Provides methods for managing packs, ComfyUI-Manager queue operations, and system functions
* Note: This service should only be used when Manager state is NEW_UI
*/
export const useComfyManagerService = () => {
const isLoading = ref(false)
const error = ref<string | null>(null)

// Check if manager service should be available
const isManagerServiceAvailable = () => {
const managerStore = useManagerStateStore()
return managerStore.getManagerUIState() === ManagerUIState.NEW_UI
}

const handleRequestError = (
err: unknown,
context: string,
Expand Down Expand Up @@ -106,6 +99,12 @@ export const useComfyManagerService = () => {
): Promise<T | null> => {
const { errorContext, routeSpecificErrors, isQueueOperation } = options

// Block service calls if not in NEW_UI state
if (!isManagerServiceAvailable()) {
error.value = 'Manager service is not available in current mode'
return null
}

isLoading.value = true
error.value = null

Expand Down