mirror of
https://github.com/tiennm99/ccs.git
synced 2026-07-16 06:16:37 +00:00
fix(image-analysis): wrap defaultDeps in arrow functions to fix circular dep capture
Direct function references in defaultDeps (checkRemoteProxy, fetchRemoteAuthStatus, getAuthStatus, getProxyTarget, initializeAccounts) are captured at module load time. Due to circular dependencies in the module graph, auth-handler.js may not have finished initializing when this module is first evaluated, causing these references to be captured as undefined. Wrapping each reference in an arrow function defers evaluation to call time, by which point all modules are fully initialized. isCliproxyRunning was already wrapped correctly; this patch applies the same pattern consistently to all deps. Fixes #973
This commit is contained in:
@@ -29,11 +29,11 @@ interface ImageAnalysisRuntimeStatusDeps {
|
||||
}
|
||||
|
||||
const defaultDeps: ImageAnalysisRuntimeStatusDeps = {
|
||||
checkRemoteProxy,
|
||||
fetchRemoteAuthStatus,
|
||||
getAuthStatus,
|
||||
getProxyTarget,
|
||||
initializeAccounts,
|
||||
checkRemoteProxy: (...args) => checkRemoteProxy(...args),
|
||||
fetchRemoteAuthStatus: (...args) => fetchRemoteAuthStatus(...args),
|
||||
getAuthStatus: (...args) => getAuthStatus(...args),
|
||||
getProxyTarget: () => getProxyTarget(),
|
||||
initializeAccounts: () => initializeAccounts(),
|
||||
isCliproxyRunning: () => isCliproxyRunning(),
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user