Skip to content

Reuse the created window handle during startup - #318

Merged
PathGao merged 1 commit into
sftwrdotdev:masterfrom
PathGao:fix/reuse-created-window-handle
Aug 2, 2026
Merged

Reuse the created window handle during startup#318
PathGao merged 1 commit into
sftwrdotdev:masterfrom
PathGao:fix/reuse-created-window-handle

Conversation

@PathGao

@PathGao PathGao commented Jul 31, 2026

Copy link
Copy Markdown
Collaborator

Fixes #317

Uses the handle returned by WebviewWindowBuilder::build() for initial theme application, file delivery, focusing, installer sizing, and centering. This removes two registry lookup unwraps that could panic if window lifecycle state changes during startup.

Adds a regression test that rejects those startup lookup unwraps.

This is stacked after #316 and its predecessors. Merge the predecessor chain first.

Validated with npm ci, npm audit (0 vulnerabilities), npm run check (0 errors, 0 warnings), npm test (137 passing), npm run build, and cargo test (21 passing).

@PathGao

PathGao commented Jul 31, 2026

Copy link
Copy Markdown
Collaborator Author

@alecdotdev This startup-lifecycle guard removes two avoidable unwraps after window creation. It is stacked after #316 and its predecessors; please review in that order.

@PathGao
PathGao force-pushed the fix/reuse-created-window-handle branch from 96b1124 to ea0db7c Compare August 2, 2026 03:58
@PathGao
PathGao merged commit 0defb87 into sftwrdotdev:master Aug 2, 2026
5 checks passed
@PathGao
PathGao deleted the fix/reuse-created-window-handle branch August 2, 2026 06:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Avoid a startup panic if a just-created window is no longer in the registry

1 participant