fix(desktop): start receive server when launched hidden to tray - #3196
Open
davidboulay wants to merge 3 commits into
Open
fix(desktop): start receive server when launched hidden to tray#3196davidboulay wants to merge 3 commits into
davidboulay wants to merge 3 commits into
Conversation
When the app autostarts hidden (e.g. --hidden), HomePage is never built, so postInit() — which starts the HTTP receive server — never runs. Multicast discovery still runs (in the isolate), so the device looks discoverable but cannot actually receive files until the window is opened once. Start the server from preInit() after isolate setup, guarded to desktop. startServer() already guards against double-start, so the later postInit() call is a harmless no-op.
Show a native desktop notification when a transfer completes so the user gets visible feedback even when the window is hidden (e.g. started in the tray). The notification exposes an "Open folder" action that reveals the received file(s) in the file manager. On Linux the platform notification plugin does not deliver notification body clicks, so an explicit action button is used; macOS/Windows also wire the body click to the same handler. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Tienisto
force-pushed
the
main
branch
9 times, most recently
from
August 11, 2026 16:12
b51d94e to
40dcf0e
Compare
4 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fixes #3195.
When LocalSend is launched hidden to the tray on desktop (e.g. autostart with
--hidden), the device is discoverable but cannot receive files until the main window is opened once.Root cause: multicast discovery is started early in
preInit(isolate setup), but the HTTP(S) receive server is only started frompostInit(), which runs fromHomePage.initState. When the app starts hidden, the home page is never built, sopostInit()never fires and the server never binds — UDP discovery is up, but the TCP receive port is down.Fix: start the receive server during
preIniton desktop, decoupled from the home page.startServer()already guards against double-start, so the laterpostInit()call becomes a no-op when the window is eventually opened.Verified on Linux: launched with
--hidden, the TCP server binds (ss -ltnupshowsLISTEN :53317),GET /api/localsend/v2/inforeturns 200, and a real transfer from another device completes with the window never shown.Second commit: receive notification (desktop)
While testing the hidden path I noticed there is no feedback at all when a file is received while the window is hidden — the file just silently lands in the destination folder. The second commit adds a native desktop notification on receive completion, with an "Open folder" action that reveals the received file(s).
local_notifier(from the same leanflutter family as the already-usedwindow_manager/tray_manager).onClick) is also wired for the other desktop platforms, where the plugin does deliver it.en.jsononly; other locales fall back to English until translated.The two changes are kept as separate commits so they can be split if you'd prefer to land them independently.
Test plan
/inforeturns 200, real file transfer completes with no window shownflutter analyzeclean on changed files