Compare commits

..

3 Commits

Author SHA1 Message Date
NimBold 89a1ab60aa test(startup): isolate post-load IPC control (#37)
- Issue #37: test whether a single command is safe after the document load callback returns.
- Keep the native shell unchanged while replacing the renderer with one post-load IPC call.

Refs #37.
2026-08-27 23:14:49 +03:30
NimBold 639f5bf091 fix(startup): defer renderer IPC past load callback (#37)
- Issue #37: Windows still overflowed when startup IPC ran from the WebView2 load callback.
- Release the renderer startup gate on the next event-loop task after load returns.
- Keep logger and console forwarding behind the same post-load boundary.

Fixes #37.
2026-08-27 22:45:55 +03:30
NimBold 97f15dee37 fix(startup): gate renderer IPC on document load (#37)
- Issue #37: Windows 1.4.0 exited with STATUS_STACK_OVERFLOW before showing the main window.
- Gate lazy entrypoint imports, Zustand persistence, logger initialization, and console forwarding until WebView2 document load.
- Preserve the native Ready reveal and pending-window restore lifecycle across platforms.
- Show a closeable startup error if the main entrypoint cannot load.

Fixes #37.
2026-08-27 22:26:53 +03:30
2 changed files with 30 additions and 6 deletions
+13 -1
View File
@@ -18553,6 +18553,17 @@ pub fn run() {
main_window_builder = main_window_builder
.inner_size(startup_size.width as f64, startup_size.height as f64)
.prevent_overflow();
#[cfg(target_os = "windows")]
{
// Wry installs its parent WM_SETFOCUS handler while WebView2
// is still being initialized. Keep the host hidden and
// non-activatable until RunEvent::Ready so Windows cannot
// re-enter that handler during native construction.
main_window_builder = main_window_builder
.visible(false)
.focused(false)
.focusable(false);
}
main_window_builder
.build()
.map_err(|error| format!("failed to create main window: {error}"))?;
@@ -19890,7 +19901,8 @@ pub fn run() {
.run(|app_handle, event| match event {
tauri::RunEvent::Ready => {
mark_main_window_startup_complete(app_handle);
#[cfg(not(target_os = "windows"))]
#[cfg(target_os = "windows")]
reveal_main_window(app_handle);
restore_pending_main_window(app_handle);
}
#[cfg(target_os = "macos")]
+17 -5
View File
@@ -1,8 +1,20 @@
import { initLogger } from "./utils/logger";
import { invoke } from '@tauri-apps/api/core';
void initLogger();
const rootElement = document.getElementById("root");
const rootElement = document.getElementById('root');
if (rootElement) {
rootElement.textContent = "Firelink startup control";
rootElement.textContent = 'Firelink startup control';
}
const documentLoaded = new Promise<void>(resolve => {
const releaseAfterNativeLoad = () => window.setTimeout(resolve, 0);
if (document.readyState === 'complete') {
releaseAfterNativeLoad();
} else {
window.addEventListener('load', releaseAfterNativeLoad, { once: true });
}
});
void documentLoaded.then(async () => {
await invoke<number>('begin_dock_badge_session');
if (rootElement) rootElement.textContent = 'Firelink post-load IPC control';
});