Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
12 changes: 6 additions & 6 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions pnpm-workspace.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ catalog:
'@astrojs/mdx': ^7.0.5
'@astrojs/sitemap': ^3.7.3
'@astrojs/vue': ^7.0.2
'@comfyorg/comfyui-desktop-bridge-types': 0.4.0
'@comfyorg/comfyui-desktop-bridge-types': 0.5.0
'@comfyorg/comfyui-electron-types': 0.6.2
'@comfyorg/sdk': 0.2.0
'@customerio/cdp-analytics-browser': ^0.5.3
Expand Down Expand Up @@ -209,7 +209,7 @@ overrides:

# Transitional - drop each entry once that version is older than the release-age gate.
minimumReleaseAgeExclude:
- '@comfyorg/comfyui-desktop-bridge-types@0.4.0'
- '@comfyorg/comfyui-desktop-bridge-types@0.5.0'
- '@comfyorg/comfy-multi-player@0.3.6'

patchedDependencies:
Expand Down
11 changes: 6 additions & 5 deletions src/platform/auth/desktopHost/desktopHostAuthBridge.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,9 @@ import type {

export type DesktopHostAuthState = ComfyDesktop2AuthState

/** `switchWorkspace` lands with bridge types 0.5.0 (Comfy-Desktop #1671). */
export interface DesktopHostAuthBridge extends ComfyDesktop2AuthBridge {
/** Absent on Desktop builds before Comfy-Desktop #1671. */
switchWorkspace?(workspaceId: string): Promise<DesktopHostAuthState>
}
/** `switchWorkspace` is absent on Desktop builds before Comfy-Desktop #1671. */
export type DesktopHostAuthBridge = Omit<
ComfyDesktop2AuthBridge,
'switchWorkspace'
> &
Partial<Pick<ComfyDesktop2AuthBridge, 'switchWorkspace'>>
19 changes: 19 additions & 0 deletions src/platform/workspace/stores/teamWorkspaceStore.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2400,6 +2400,25 @@ describe('useTeamWorkspaceStore', () => {
expect(store.activeWorkspaceId).toBeNull()
})

it('reports a failed refresh and keeps no active workspace', async () => {
const store = useTeamWorkspaceStore()
await store.initialize()
const failure = new Error('list failed')
mockWorkspaceApi.list.mockRejectedValue(failure)

pushHostState(hostOn(mockMemberWorkspace.id))

await vi.waitFor(() =>
expect(reportError).toHaveBeenCalledWith(
failure,
expect.objectContaining({
errorType: 'error_refreshing_workspaces_for_desktop_host'
})
)
)
expect(store.activeWorkspaceId).toBeNull()
})

it('follows a switch made in Desktop', async () => {
mockWorkspaceApi.list.mockResolvedValue({
workspaces: [
Expand Down
7 changes: 6 additions & 1 deletion src/platform/workspace/stores/teamWorkspaceStore.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1062,7 +1062,12 @@ export const useTeamWorkspaceStore = defineStore('teamWorkspace', () => {
const isListed = () =>
workspaces.value.some((w) => w.id === hostWorkspaceId)
if (!isListed()) {
await refreshWorkspaces().catch(() => undefined)
await refreshWorkspaces().catch((error: unknown) =>
reportError(error, {
errorType: 'error_refreshing_workspaces_for_desktop_host',
surface: 'workspace'
})
)
if (
isStaleIdentity(generation) ||
desktopHostUser.value?.workspaceId !== hostWorkspaceId
Expand Down
Loading