[GH-ISSUE #1367] Fix IPC API type mismatches flagged with @ts-expect-error #381

Closed
opened 2026-10-31 22:12:19 +00:00 by bsakaguchi · 1 comment
Owner

Originally created by @webfiltered on GitHub (Oct 8, 2025).
Original GitHub issue: https://github.com/Comfy-Org/desktop/issues/1367

Originally assigned to: @webfiltered on GitHub.

Several IPC API type mismatches were discovered during the type-safe IPC migration and marked with @ts-expect-error for tracking. These need to be investigated and fixed.

API Type Fixes Needed

src/desktopApp.ts:251

  • IPC_CHANNELS.COMPLETE_VALIDATION - API says this should return false; currently always treated as falsy
    • Handler needs to be updated to actually return false instead of returning nothing

src/install/troubleshooting.ts:60

  • IPC_CHANNELS.VALIDATE_INSTALLATION - Should not return anything (should return void)
    • Handler currently returns validation result but this is not consumed by frontend

src/main-process/comfyDesktopApp.ts:152

  • IPC_CHANNELS.TERMINAL_RESTORE - Returning undefined is an error and will throw in frontend component lifecycle
    • Handler can return undefined when terminal doesn't exist, but type expects non-optional return
    • Need to either guarantee terminal exists or update type to allow undefined

src/preload.ts:156

  • IPC_CHANNELS.GET_BASE_PATH - API typed as Promise<string> but actually returns Promise<string | undefined>
    • Type contract claims it always returns a string, but implementation can return undefined
    • Frontend API signature needs to be updated to Promise<string | undefined>

src/preload.ts:313

  • IPC_CHANNELS.GET_GPU - Returns TorchDeviceType instead of GpuType
    • API is meant to return GPU type for user display
    • Backend is returning internal torch device type instead
    • Need to convert or fix the handler to return proper GpuType

Context

These type mismatches were flagged during the type-safe IPC system implementation in #1366. Each represents a genuine API mismatch that should be fixed to ensure type safety across the IPC boundary.

┆Issue is synchronized with this Notion page by Unito

Originally created by @webfiltered on GitHub (Oct 8, 2025). Original GitHub issue: https://github.com/Comfy-Org/desktop/issues/1367 Originally assigned to: @webfiltered on GitHub. Several IPC API type mismatches were discovered during the type-safe IPC migration and marked with `@ts-expect-error` for tracking. These need to be investigated and fixed. ## API Type Fixes Needed ### src/desktopApp.ts:251 - [ ] `IPC_CHANNELS.COMPLETE_VALIDATION` - API says this should return `false`; currently always treated as falsy - Handler needs to be updated to actually return `false` instead of returning nothing ### src/install/troubleshooting.ts:60 - [ ] `IPC_CHANNELS.VALIDATE_INSTALLATION` - Should not return anything (should return `void`) - Handler currently returns validation result but this is not consumed by frontend ### src/main-process/comfyDesktopApp.ts:152 - [ ] `IPC_CHANNELS.TERMINAL_RESTORE` - Returning `undefined` is an error and will throw in frontend component lifecycle - Handler can return `undefined` when terminal doesn't exist, but type expects non-optional return - Need to either guarantee terminal exists or update type to allow `undefined` ### src/preload.ts:156 - [ ] `IPC_CHANNELS.GET_BASE_PATH` - API typed as `Promise<string>` but actually returns `Promise<string | undefined>` - Type contract claims it always returns a string, but implementation can return undefined - Frontend API signature needs to be updated to `Promise<string | undefined>` ### src/preload.ts:313 - [ ] `IPC_CHANNELS.GET_GPU` - Returns `TorchDeviceType` instead of `GpuType` - API is meant to return GPU type for user display - Backend is returning internal torch device type instead - Need to convert or fix the handler to return proper `GpuType` ## Context These type mismatches were flagged during the type-safe IPC system implementation in #1366. Each represents a genuine API mismatch that should be fixed to ensure type safety across the IPC boundary. - Ref: #1366 ┆Issue is synchronized with this [Notion page](https://www.notion.so/Issue-1367-Fix-IPC-API-type-mismatches-flagged-with-ts-expect-error-2866d73d365081dd9d2bc046302ee239) by [Unito](https://www.unito.io)
Author
Owner

@dosubot[bot] commented on GitHub (Jan 7, 2026):

Hi, @webfiltered. I'm Dosu, and I'm helping the desktop team manage their backlog and am marking this issue as stale.

Issue Summary:

  • You reported multiple IPC API type mismatches flagged by @ts-expect-error during the type-safe IPC migration.
  • The issue highlights the need for updates to handlers to return correct types, allow undefined, or convert return types to match API contracts.
  • These mismatches were identified in PR #1366 and require fixes to ensure proper type safety.
  • No further comments or activity have been posted since your initial report.

Next Steps:

  • Please let me know if this issue is still relevant with the latest version of the desktop app by commenting here.
  • If I don’t hear back within 7 days, this issue will be automatically closed.

Thanks for your understanding and contribution!

<!-- gh-comment-id:3719591083 --> @dosubot[bot] commented on GitHub (Jan 7, 2026): Hi, @webfiltered. I'm [Dosu](https://dosu.dev), and I'm helping the desktop team manage their backlog and am marking this issue as stale. **Issue Summary:** - You reported multiple IPC API type mismatches flagged by `@ts-expect-error` during the type-safe IPC migration. - The issue highlights the need for updates to handlers to return correct types, allow `undefined`, or convert return types to match API contracts. - These mismatches were identified in PR #1366 and require fixes to ensure proper type safety. - No further comments or activity have been posted since your initial report. **Next Steps:** - Please let me know if this issue is still relevant with the latest version of the desktop app by commenting here. - If I don’t hear back within 7 days, this issue will be automatically closed. Thanks for your understanding and contribution!
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
Comfy-Org/desktop#381
No description provided.