Implements RFC 6455 compliant ping/pong health checking to detect dead connections:
- Send ping frames every 10 seconds
- Monitor pong responses with 5-second timeout after each ping
- Add graceful shutdown for WebSocket reconnection loop
- Implement shutdown signal to stop connection attempts on exit
- Track and cancel tray handler tasks to prevent duplicates
- Handle app exit event to trigger WebSocket cleanup
Fixes WSAStartup error 10093 and application hang on shutdown.
fix(traymenu): update tray menu label from "Secured" to "unknown"
fix(notifications): log error when notification is clicked without an associated action
- Add create_debounced_window_state_saver() function in window.rs
- Extract WINDOW_STATE_FLAGS_TO_SAVE and WINDOW_STATE_SAVE_TIMEOUT constants
- Listen to tauri://move and tauri://resize events with 5-second debouncing
- Automatically save window state after positioning changes settle
- Prevent window position loss during system shutdowns/restarts
The debouncing mechanism avoids excessive disk I/O during active window
manipulation while ensuring recent position changes are preserved even
when the application doesn't close normally.
Fixes window position being lost when system restarts before user
manually closes the application.
https://github.com/safing/portmaster/issues/2011
Problem:
System browsers launched from the Portmaster UI (e.g., when a user clicks a link) may be incorrectly detected as Portmaster UI child processes.
Solution:
The Tauri UI app now sets the PORTMASTER_UI_WEBVIEW_PROCESS environment variable for all child WebView processes. Portmaster-core uses this variable to accurately determine if a process is truly related to the Portmaster UI.
Previously, the API endpoint was defined using `localhost`, which could resolve to the IPv6 address `::1`.
This caused issues because the Portmaster core service is listening on `127.0.0.1:817` and only fast-tracking connections to that specific IPv4 address.
Replaced the http-client plugin, as it does not support keep-alive connections.
Each request opened a new TCP connection to the service, which was inefficient.
The new custom `send_tauri_http_request` command, exposed to the UI, uses an application-wide `reqwest::Client`, which supports idle (persistent) connections.