improve shortcut 'open with' handling

This commit is contained in:
olcxja 2026-10-04 20:50:10 +02:00
commit 6565ded4d5
2 changed files with 73 additions and 34 deletions

View file

@ -188,7 +188,15 @@ handlers in src/ipc/. Keep new APIs in that pattern.
when it sits inside the prefix's drive_c, `Z:\...` otherwise. Giving a file
to an app that is ALREADY running is a handoff (runGame `handoff: true`):
an extra untracked process, no log/playtime writes, because the app's own
single-instance logic is what actually opens the file.
single-instance logic is what actually opens the file. The second-instance
handoff must never read a value from the token next to its option: Electron
RE-SERIALIZES that argv (all switches first, their values after, the dev app
path among them), so `--launch <id> --file <path>` arrives as
`--launch --file --allow-file-access-from-files <id> <path>`. argv.js pairs
options with positionals IN ORDER (inline `--name=value` wins, the dev app
path is skipped); reading the next token used to take the launch id as the
opened file, so an app started without its image.
`electron test/argv-handoff.test.js` proves the real serialization.
- A sender hashing a big unit is minutes of network silence: it pings
`/plwl/ping` (+token) every HEARTBEAT_MS for the whole sync, the receiver's
handler re-arms its popup watchdog (stage 'wait' changes nothing on screen),