Repository navigation
fix(startup): avoid portal re-entry during file manager activation - #1811
Conversation
Local validation and scopeThe change is confined to the FileManager1 activation launch path, but it shares Environment: the project's verified pinned test image,
The original desktop reproduction and successful local service-entry workaround |
The FileManager1 service restart adds no-portals to GDK_DEBUG, and every program Strata launched afterwards inherited it. GDK's no-portals wins over its sandbox check, so a Flatpak GTK app opened from that Strata lost its portal file chooser and settings. Record the original GDK_DEBUG when restarting, and restore it on the GIO launch contexts, terminal, program, action and Settings restart commands.
f3fa682 to
87b0946
Compare
Review and cleanupBranch rebuilt on the rewritten Review against the description and #1810.
Fixes pushed
Validation
CI: all checks green as of 20:09 UTC on |
|
Thanks for the cleanup and for addressing the inherited environment. I reviewed 87b0946; restoring the original value at the launch boundaries is a useful improvement over the documented tradeoff in my initial patch. One remaining launch boundary appears to be Suggested follow-up: restore the environment on the provider command before spawning it, and exercise a real provider (or a provider fixture that launches a child) to verify the original debug flags reach the child and the internal marker does not. This is a static-review finding; the inheritance path is present, but I have not reproduced a user-visible LocalSend failure. A second useful follow-up is to promote the isolated cold-activation probe into a maintained regression: own the portal name on a private bus, synchronously call FileManager1 without dispatching callbacks, activate Strata from its service entry without an external no-portals override, and require a successful response within a short deadline. The parameter-policy tests and warm FileManager1 QA scenario do not exercise that startup ordering. My earlier full QA results apply to the initial patch, not to the new child-environment changes; the current CI Rust results are green and the QA job is skipped, as noted above. |
Description
Avoid the circular portal wait during cold FileManager1 activation by adding
no-portalstoGDK_DEBUGbefore GTK initialization for--gapplication-service. Reuse the existing safe re-exec path, preserve otherdebug flags (including non-UTF-8 bytes), and stop interpreting options after
--. Normal application launches, helper modes and the FileChooser backend donot acquire this override.
With xdg-desktop-portal 1.22.1, OpenDirectory synchronously waits for ShowItems.
GTK can synchronously query that same portal's host registry before Strata's
FileManager1 interface is ready, producing a roughly 25-second circular wait.
Moving the reply earlier in the ShowItems handler would not fix this startup
ordering problem.
This deliberately scoped compatibility mitigation disables GTK portal use for
the lifetime of the service-activated process. It does not make the desktop
portal's dispatch asynchronous; that remains the preferable upstream fix.
The packaging documentation records the tradeoff.
Visual evidence
N/A — startup responsiveness and D-Bus behavior; no visual layout changes.
How to test
FileManager1 activation service to execute the built Strata binary with
--gapplication-service. Remove any externalGDK_DEBUG=no-portalsworkaround so this exercises the application fix.
download. The cold-start case is essential: an already-running Strata
process does not exercise GTK initialization.
Failed to call ShowItemstimeout. Repeat with Strata already running.neither launch should acquire this FileManager1-specific override.
Expected result: Cold and warm reveals succeed without the 25-second
stall, and other portal consumers remain responsive.
Related issue
Closes #1810