Skip to content

fix(notification): avoid startup permission IPC errors (fix #3562) - #3729

Draft
Sealdot wants to merge 1 commit into
tauri-apps:v2from
Sealdot:codex/fix-notification-startup-permission-3562
Draft

Sealdot wants to merge 1 commit into
tauri-apps:v2from
Sealdot:codex/fix-notification-startup-permission-3562

Conversation

@Sealdot

@Sealdot Sealdot commented Oct 23, 2026

Copy link
Copy Markdown

AI assistance: This patch and its tests were prepared with Codex.

The notification initialization script currently queries permission from the initial about:blank document. On WebKitGTK this can reach IPC with an opaque origin, as reported in #3562. A rejected startup query also becomes an unhandled promise rejection.

Skip automatic priming on about:blank documents, including URL fragments and queries, and run it normally when the initialization script is injected into the real document. Handle a failed automatic query while leaving the permission at default, so an explicit permission query or request can retry. Explicit request failures still reject to the caller. The existing Windows shortcut and about:srcdoc priming are preserved.

Adds a dependency-free Node regression suite for the actual generated injection script, plus test:notification-init to run it. The suite replaces only the IPC transport and uses separate VM contexts for the documents; it does not reproduce native navigation or WebKitGTK's startup timing.

Validation on macOS 27.0.1 arm64, Node 24.14.0, TypeScript 6.0.3, Rollup 4.64.12 and Rust 1.97.1:

  • node --test .scripts/tests/notification-init.test.js: original generated script 10 passed / 5 failed; candidate 15 passed / 0 failed with the same tests. Covers startup URLs, subsequent document initialization, about:srcdoc, all permission states, Windows, handled startup rejection, retry and explicit request rejection.
  • All 28 plugin JS builds, full workspace ESLint, Prettier and the workspace TypeScript check passed. Tools were invoked directly using existing dependencies; the two Rollup 4.64.12 archives match the lockfile's integrity values. No lockfile changes.
  • Notification crate: default and all-features Clippy with -D warnings, all-targets/all-features tests (4 passed), doc tests (4 compile-only examples passed), Rust 1.90.0 MSRV check, and workspace Rust formatting passed.
  • Change-file, license-header and whitespace checks passed.

Related overlap: draft #3541 changes desktop permission initialization to always grant permission. This patch retains the current backend permission model and handles the startup document and rejection paths; those changes would need reconciling if #3541 proceeds.

Native acceptance still pending:

  • Reproduce and verify real Linux WebKitGTK startup navigation and IPC on the affected custom-protocol app, including rejection behavior.
  • Run the existing native notification E2E suite on the supported platforms. This local VM suite is not native or cross-platform acceptance.

Fixes #3562.

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.

[notification] init script fires IPC on about:blank → 500 'Origin header is not a valid URL' on Linux (WebKitGTK)

1 participant