Skip to content

Verify SetStdHandle GUI stderr redirect (#2137/PR#2614) doesn't interfere with WebView2/Tauri #2615

Closed

Description

@mstomar125

Overview

#2137 (PR#2614) added a SetStdHandle(STD_ERROR_HANDLE/STD_OUTPUT_HANDLE, <log file>) redirect at GUI startup (packages/desktop-app/src-tauri/src/main.rs, release+Windows only) so the Tauri GUI process's own eprintln!/println! calls (which are otherwise silently discarded — windows_subsystem = "windows" means no console exists at all in a release build) land in a log file instead.

Problem Statement

#2137's own issue text explicitly asked for verification that this redirect "doesn't interfere with WebView2/Tauri's own expectations." That verification was not fully closed: the standalone Windows harness used to prove the redirect works (real Windows hardware, but a scratch binary with no Tauri/WebView2 dependency, since the full GUI crate can't build on that machine without libclang/LLVM — a pre-existing, already-tried-and-blocked environment gap) could not include WebView2 in the test. The PR's own review assessed the real risk as low (WebView2's IPC doesn't depend on inherited stdio handles) but flagged this as worth a named follow-up rather than treating the loop as fully closed.

Proposed Solution

Once a Windows environment can build the full nodespace-app crate (i.e., once libclang/LLVM is available there, or via a CI/cross-compilation path), launch the real GUI binary in release mode and confirm:

  • The app starts and WebView2 renders normally (no visible regression from the stdio redirect)
  • A real schema-parse diagnostic (triggering the SchemaNode::from_node code path PR#2614 exists to rescue) actually lands in the redirected log file when triggered through the real GUI, not just the standalone harness

Acceptance Criteria

  • Real Tauri GUI binary launches normally in release mode with the SetStdHandle redirect active
  • No WebView2/Tauri IPC regression observed
  • A real schema-parse diagnostic triggered through the actual GUI lands in the log file

Reference Files

  • packages/desktop-app/src-tauri/src/main.rs — the SetStdHandle redirect
  • packages/desktop-app/src-tauri/src/commands/schemas.rs — the diagnostic path it rescues

Related Issues

Priority

Low — assessed real risk is low (WebView2's IPC doesn't depend on inherited stdio handles), this is closing a verification gap, not a known bug.

Activity

  1. malibio commented on Oct 12, 2026

    @malibio
    Collaborator

    Verification on a Windows 11 ARM64 VM

    Setup: the published v0.3.5 x64 installer (NodeSpace_0.3.5_x64_en-US.msi), release build, running under x64 emulation in a UTM virtual machine on an Apple Silicon Mac. Windows 11 24H2, build 26100.4349 at install, 26100.9457 after a Windows Update reboot.

    Results

    • Launch and WebView2: no regression observed. The app launches, the UI renders, creating a node works with no errors, and the View menu actions work.
    • The redirect is applied. On the first launch after install, the GUI process's own tracing output (nodespace_app_lib INFO lines, 2,091 bytes) landed in %USERPROFILE%\.nodespace\logs\nodespace-app.log, and nodespace-app-error.log was created. On later launches both files are recreated after deletion and are held open by the running app: an exclusive open fails with a sharing violation while NodeSpace runs and succeeds after it quits. So SetStdHandle took effect.
    • Not reproduced on later launches. After the reboot, neither the startup tracing nor the println! fired by View → Toggle Sidebar (used through the menu bar item, not a shortcut) reached nodespace-app.log, which stayed at 0 bytes across two launches. Ruled out: HOME (the redirect uses dirs::home_dir()), the open mode (create + append), the prior state of the files (deleted and recreated), and the click path. Not determined: whether this is a NodeSpace issue or an effect of the OS update, x64 emulation or the VM. The OS build changed between the launch that logged and the ones that did not.
    • Acceptance criterion 3 as written can't be performed. The SchemaNode::from_node diagnostic was removed when SchemaNode became one wire type, so the original trigger no longer exists. The substitute used was the menu println! above.

    Side observations

    Remaining

    A run on x64 Windows hardware, or a fresh install of a build containing the #3761 fix, to separate a product issue from an environment one. A Windows build of the merged branch exists as a workflow artifact for that.

  2. malibio commented on Oct 12, 2026

    @malibio
    Collaborator

    Update: verification complete, defect tracked in #3768

    Further runs on the same VM narrowed the later-launch silence reported above to the launch method, not the OS update:

    • Launched from the installer's finish screen or from PowerShell, the GUI process's output (tracing startup lines through the shutdown sequence) lands in nodespace-app.log.
    • Launched from the Start menu, which is how users and the autorun entry launch it, nothing lands, across seven launches on two builds. The redirect's files are opened and held by the app in that case (exclusive open fails while it runs, succeeds after it quits), and a launch that re-extracted the daemon sidecars was still silent.

    Answers to what this issue asked:

    • No WebView2/Tauri interference: the app launches, renders, creates nodes and handles menu actions on every launch path.
    • The original from_node trigger no longer exists, so a diagnostic was observed through the app's own startup and shutdown output and the menu println!.
    • The redirect does not deliver output in the Start-menu launch path. That is a defect in the feature this issue verified, tracked as Windows GUI app's log redirect delivers no output when the app is launched from the Start menu #3768 with the full launch table, what was ruled out, and what is not yet determined (the mechanism, and reproduction on x64 hardware outside a VM).

    Closing this as verified; the open defect continues in #3768.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions