Files
magpie/internal/proc
yetone 1cb346f2dc gui: on Linux the folder and Backups buttons start the opener and return (pkh1585)
pkh1585 on Discord: on Linux, clicking the Library's folder / Backups
button froze magpie and the file manager that opened closed by itself.

Cause: Linux openFolder was Wails' OpenFileManager, which runs the desktop's
file manager (the inode/directory .desktop Exec, or xdg-open) with cmd.Run
under a 10 second context. A file manager that isn't running yet stays in
the foreground, so the click waited the full 10 seconds and then the
context killed the window that had just opened. Windows had the same shape
and was fixed earlier (folder_windows.go); macOS's `open` returns at once.

Fix: proc.OpenFolder (Linux) starts xdg-open (else gio open, exo-open) with
no stdio and a session of its own, reaps it in a goroutine, and returns. All
callers go through Host.OpenFolder (Library folder, Backups reveal, usage
and backup saves, logs/config reveals, browser reveal), so every sibling is
reached. macOS keeps Wails' way (folder_other.go is now !linux).

Run:
- mote-run go test ./internal/proc, wsl-run (magpie-desktop) go test
  ./internal/proc: ok. New TestOpenFolderDoesNotWaitForTheFileManager: with
  the Wait made synchronous it fails on WSL (waited 1m0s); with Setsid off
  it fails (shares magpie's session); green with the fix, -count=3.
- Real XFCE (magpie-desktop, DISPLAY :0, real Thunar): the old way
  (`timeout 10 thunar dir`) blocked 10s and killed Thunar (rc 124, no
  thunar left); `setsid xdg-open dir` returned at once and Thunar stayed up
  12s later.
- gofmt clean; go vet ./internal/proc for linux, windows (mote), linux (wsl);
  go vet ./internal/gui on macOS.

Not tried: a built Linux magpie GUI clicking the real button (WSL has no
gtk4/webkitgtk-6.0, so internal/gui can't build there, and linux gui vet
wasn't run); Omarchy/Hyprland; AppImage env (LD_LIBRARY_PATH) leaking into
the opener, which is unchanged; the full go test ./... suite and GUI tests
(no GUI or JS file changed).
2026-11-04 04:47:02 +08:00
..
gui, proc: the Gateway card quits an older magpie serving the gateway and takes it over, or restarts the gateway (leslie_luo on Discord) — the card said an older magpie served the gateway and to quit it, with no way to tell which process that was. With an older magpie on the port it now has "Quit magpie {v} and take over": the process listening on the gateway's port is found (lsof on a Mac, /proc on Linux, Get-NetTCPConnection on Windows), its program path checked to be magpie's (magpie, magpie-*, dial, .exe/.old), asked to quit (SIGTERM, then SIGKILL after 5 s; TerminateProcess on Windows) and this magpie serves the gateway at once instead of within 15 s. Otherwise the card has "Restart gateway" ("Start gateway" when none runs); a magpie of this version or newer gets no button. Anything else on the port is never ended: a program that isn't magpie, one of another user or an administrator, one that won't quit, or a magpie a LaunchAgent/systemd unit/scheduled task starts again is said under the button with its path and pid, in en/zh/ja/de. TestGatewayFixQuitsOnlyAMagpie (copies of the test binary on a port of its own: one named other-server answering as magpie is left running, one named magpie is quit and the gateway is served here, then restarted) and gateway-takeover.test.cjs (WebKit and Chromium, en and zh, no scroll, no left border) fail without the change; TestListeningOn/TestIsMagpie pass on macOS and in a Linux container. go vet, go build (darwin, GOOS=linux nogui, GOOS=windows) and go test -tags nogui ./... under a temp HOME pass.
2026-10-05 15:05:31 +08:00
gui, proc: the Gateway card quits an older magpie serving the gateway and takes it over, or restarts the gateway (leslie_luo on Discord) — the card said an older magpie served the gateway and to quit it, with no way to tell which process that was. With an older magpie on the port it now has "Quit magpie {v} and take over": the process listening on the gateway's port is found (lsof on a Mac, /proc on Linux, Get-NetTCPConnection on Windows), its program path checked to be magpie's (magpie, magpie-*, dial, .exe/.old), asked to quit (SIGTERM, then SIGKILL after 5 s; TerminateProcess on Windows) and this magpie serves the gateway at once instead of within 15 s. Otherwise the card has "Restart gateway" ("Start gateway" when none runs); a magpie of this version or newer gets no button. Anything else on the port is never ended: a program that isn't magpie, one of another user or an administrator, one that won't quit, or a magpie a LaunchAgent/systemd unit/scheduled task starts again is said under the button with its path and pid, in en/zh/ja/de. TestGatewayFixQuitsOnlyAMagpie (copies of the test binary on a port of its own: one named other-server answering as magpie is left running, one named magpie is quit and the gateway is served here, then restarted) and gateway-takeover.test.cjs (WebKit and Chromium, en and zh, no scroll, no left border) fail without the change; TestListeningOn/TestIsMagpie pass on macOS and in a Linux container. go vet, go build (darwin, GOOS=linux nogui, GOOS=windows) and go test -tags nogui ./... under a temp HOME pass.
2026-10-05 15:05:31 +08:00
gui, proc: the Gateway card quits an older magpie serving the gateway and takes it over, or restarts the gateway (leslie_luo on Discord) — the card said an older magpie served the gateway and to quit it, with no way to tell which process that was. With an older magpie on the port it now has "Quit magpie {v} and take over": the process listening on the gateway's port is found (lsof on a Mac, /proc on Linux, Get-NetTCPConnection on Windows), its program path checked to be magpie's (magpie, magpie-*, dial, .exe/.old), asked to quit (SIGTERM, then SIGKILL after 5 s; TerminateProcess on Windows) and this magpie serves the gateway at once instead of within 15 s. Otherwise the card has "Restart gateway" ("Start gateway" when none runs); a magpie of this version or newer gets no button. Anything else on the port is never ended: a program that isn't magpie, one of another user or an administrator, one that won't quit, or a magpie a LaunchAgent/systemd unit/scheduled task starts again is said under the button with its path and pid, in en/zh/ja/de. TestGatewayFixQuitsOnlyAMagpie (copies of the test binary on a port of its own: one named other-server answering as magpie is left running, one named magpie is quit and the gateway is served here, then restarted) and gateway-takeover.test.cjs (WebKit and Chromium, en and zh, no scroll, no left border) fail without the change; TestListeningOn/TestIsMagpie pass on macOS and in a Linux container. go vet, go build (darwin, GOOS=linux nogui, GOOS=windows) and go test -tags nogui ./... under a temp HOME pass.
2026-10-05 15:05:31 +08:00