Login session lost on every restart (Flatpak) — embedded webview uses random local port, breaking localStorage persistence
Is there an existing issue for this problem?
- [x] I have searched the existing issues
Snapmaker_Orca Version
2.3.5
Operating System (OS)
Linux
OS Version
Cachyos
Additional system information
Additional system information
Installed via Flatpak (io.github.Snapmaker.Snapmaker_Orca). Confirmed this is not a system keyring issue — secret-tool store/lookup work correctly (KWallet + ksecretd), and the flatpak manifest correctly declares org.freedesktop.secrets=talk under [Session Bus Policy].
Printer
Snapmaker U1
How to reproduce
- Install Snapmaker Orca via Flatpak
- Launch the app, log in with email + password
- Fully quit the app
- Relaunch the app
Actual results
The email address is pre-filled (retained in a regular config file), but the login session is not — the app prompts to log in again with a password on every launch.
Root cause investigation:
The login UI is a Flutter web app served through an embedded webview from a local HTTP server (127.0.0.1:<port>), based on requests logged at startup (e.g. request for resource: /web/flutter_web/index.html).
Inspecting the persistent data directory shows the likely cause:
~/.var/app/io.github.Snapmaker.Snapmaker_Orca/data/snapmaker-orca/localstorage/ http_127.0.0.1_13619.localstorage http_127.0.0.1_13620.localstorage https_id.snapmaker.com_0.localstorage
Two separate launches produced two different localstorage files tied to two different local ports (13619 and 13620). Since localStorage is scoped per-origin (including port number), the embedded local server appears to bind to a different random port on every launch, orphaning whatever session data was written to the previous port's origin.
Notably, https_id.snapmaker.com_0.localstorage — presumably where the actual account/OAuth token is written, since id.snapmaker.com is a fixed domain — does persist across restarts. This suggests the underlying token may still be intact, but the app's "am I logged in" check likely depends on data tied to the ephemeral local-port origin rather than solely on the fixed-domain storage, preventing it from reconnecting the session.
Expected results
Login session persists across restarts (as reportedly happens on Windows/macOS builds).
Suggested fix direction:
- Bind the embedded webview's local server to a fixed port instead of a random one, or
- Make the login-state check rely solely on the fixed-domain (
id.snapmaker.com) storage rather than data tied to the ephemeral local-port origin
Project file & Debug log uploads
N/A
Checklist of files to include
- [ ] Log file
- [ ] Project file
Anything else?
Confirmed not a Flatpak sandbox permission issue — org.freedesktop.secrets=talk is already present in flatpak info --show-permissions, and the system Secret Service is functioning correctly independent of this app.
Fixed in v2.4.1 — see "Fixed an issue where Linux users' login status could not be saved" in the v2.4.1 release notes. Please test on v2.4.1 and comment/reopen if it still reproduces on your setup.