Repository navigation
fix(windows): Open after a copy or update starts the build in its own window #2158
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
742e165
f0ab1ab
7dcba67
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -800,18 +800,6 @@ ipcMain.handle('focus-comfy-window', async (_event, installationId: string) => { | |
| return false | ||
| }) | ||
|
|
||
| ipcMain.handle('open-install-window', (_event, installationId: string) => { | ||
| recordIpcInvocation('open-install-window', { installationId }) | ||
| const existing = getEntryByInstallationId(installationId) | ||
| if (existing && !existing.window.isDestroyed()) { | ||
| existing.window.show() | ||
| existing.window.focus() | ||
| return true | ||
| } | ||
| openChooserHostWindow() | ||
| return true | ||
| }) | ||
|
|
||
| ipcMain.handle( | ||
| 'close-comfy-window', | ||
| (_event, installationId: string, opts?: { skipConfirm?: boolean }) => { | ||
|
|
@@ -1118,6 +1106,22 @@ if (app.isPackaged && !app.requestSingleInstanceLock()) { | |
| } | ||
| } | ||
|
|
||
| ipcMain.handle('open-install-window', async (event, installationId: unknown) => { | ||
| if (typeof installationId !== 'string' || installationId === '') return false | ||
| recordIpcInvocation('open-install-window', { installationId }) | ||
| const requester = [...comfyWindows.values()].find( | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🟡 Medium — Unlike sibling handlers in this file (
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Fixed in 7dcba67: a sender that is not a registered panel now gets false, and nothing opens.
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🟢 Low — The requester lookup does not skip entries whose window is already destroyed, unlike the sibling handlers. A destroyed-but-still-registered entry hosting the same build yields the
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Fixed in 7dcba67: the requester lookup skips windows that are already destroyed. |
||
| (entry) => !entry.window.isDestroyed() && entry.panelView?.webContents === event.sender | ||
| ) | ||
| if (!requester) return false | ||
| try { | ||
| await openBuild(installationId, requester.windowKey) | ||
| return true | ||
| } catch (error) { | ||
| console.error('open-install-window: could not open the build', { installationId, error }) | ||
| return false | ||
| } | ||
| }) | ||
|
|
||
| registerTitlePopupIpc({ | ||
| openChooserHostWindow, | ||
| returnToDashboard, | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🟢 Low — Registration moved from module scope into the
app.whenReady()body, behind awaits likeinitDeviceId()andinitUserTier(), and that promise chain has no.catch. Any earlier startup rejection now leavesopen-install-windowpermanently unregistered, so every later invoke rejects with Electron's "No handler registered" error rather than the channel being inert. Raised by 1 of 8 reviewers (claude-opus-5-thinking-max adversarial).There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not changing: the panels that call this channel are created inside the same whenReady body, after this handler is registered, so they cannot call it earlier. A startup failure before that point stops the app anyway.