Skip to content

feat(notify): file-based diagnostic logging for the Windows toast issue (#3)#5

Merged
karem505 merged 1 commit into
masterfrom
fix/notif-diagnostic-logging
Jun 14, 2026
Merged

feat(notify): file-based diagnostic logging for the Windows toast issue (#3)#5
karem505 merged 1 commit into
masterfrom
fix/notif-diagnostic-logging

Conversation

@karem505

Copy link
Copy Markdown
Owner

Re #3 — toasts still don't appear on Windows 11 after v0.3.2, and we have no signal as to why.

Why a diagnostic build

Two things hide the failure today:

  1. No console in a GUI build. The v0.3.2 eprintln! is invisible — the reporter ran the release exe from PowerShell with stdout/stderr redirected and captured nothing.
  2. The plugin swallows the toast result. tauri-plugin-notification's show() dispatches the actual WinRT toast on a detached async task and discards its Result, so a failure can never propagate up to our code.

What this adds

A tiny dlog module writing a per-launch (truncated) session log to %LOCALAPPDATA%\whatRust\logs\whatrust.log (XDG data dir on Linux), recording the notification control flow — no message content (no PII):

  • aumid::register — the real, un-swallowed HRESULTs of the registry write + SetCurrentProcessExplicitAppUserModelID.
  • commands::notify — whether the command is invoked at all, and whether a gate (locked / notifications-disabled) suppressed it.
  • notify::show — that dispatch was reached.

This disambiguates the remaining hypotheses in one build:

  • if commands::notify invoked never appears when a message arrives → the page used a path our window.Notification shim doesn't intercept (e.g. service-worker showNotification);
  • if it appears but no toast shows → the failure is in the Windows toast layer.

Paired with a standalone PowerShell toast test (posted on #3) that checks whether the AUMID can render a banner independent of our app. No speculative shortcut/COM code until the logs say where it breaks.

Testing

  • cargo check/clippy/test --locked (Linux) — pass.
  • The #[cfg(windows)] aumid module (the match restructure around the same windows-rs calls) cross-compiles clean for x86_64-pc-windows-gnu; CI windows-latest is the full gate.
  • Headless boot: app starts, dlog::init() runs, and the log file is written end-to-end (=== session start ===).

Ships as v0.3.3 (diagnostic release).

🤖 Generated with Claude Code

…ue (#3)

v0.3.2 registered the AUMID (the reporter confirmed Get-StartApps + the HKCU
key) but toasts still don't render on Windows 11, and there's no signal as to
why: a GUI-subsystem build has no console, so the v0.3.2 eprintln! went
nowhere (the reporter's stdout/stderr redirect captured nothing). Worse, the
notification plugin's show() dispatches the toast on a detached task and
discards its result, so the plugin can never report a failure upward.

Add a tiny dlog module that writes a per-launch (truncated) session log to
%LOCALAPPDATA%\whatRust\logs\whatrust.log (and the XDG data dir on Linux),
and record the notification control flow:
- aumid::register — the real, un-swallowed HRESULTs of the registry write and
  SetCurrentProcessExplicitAppUserModelID;
- commands::notify — whether the command is invoked at all and whether a gate
  (locked / notifications-disabled) suppressed it;
- notify::show — that dispatch was reached.

No message titles/bodies are logged (no PII). This disambiguates the remaining
hypotheses in one build: if "commands::notify invoked" never appears when a
message arrives, the page used a path our window.Notification shim doesn't
intercept (e.g. the service-worker showNotification); if it appears but no
toast shows, the failure is in the Windows toast layer. Pairs with a
standalone PowerShell toast test (posted on #3) that checks whether the AUMID
can render a banner independent of the app. No speculative shortcut/COM code
until the logs tell us where it breaks. Ships as v0.3.3.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@karem505 karem505 merged commit dd2833a into master Jun 14, 2026
6 checks passed
@karem505 karem505 deleted the fix/notif-diagnostic-logging branch June 14, 2026 12:26
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.

1 participant