One copy of the tray injector and of fzt-files' command list #130
No reviewers
Labels
No labels
bug
documentation
duplicate
enhancement
good first issue
help wanted
invalid
question
queue
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
romaine-life/fzt-picker!130
Loading…
Reference in a new issue
No description provided.
Delete branch "fp17-one-copy"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
One copy of the tray injector per sign-in, and one copy of fzt-files' command list, through one-copy v0.1.0. Work package: https://openproject.home.romaine.life/wp/FP-17
Which runs take the lock
fzt-picker.exe): every run, lockfzt-picker. It is the first thing inrun(), beforeHandoff::create/publishand before the hook goes in, so a refused copy of a newer release can't republish its hook path and leave the shims on a release whose injector isn't running. A second copy logsinjector already running, so this one exitstofzt-picker.logand exits 0, with no tray icon and no hook. A lock that can't be checked is logged as a warning and the injector runs anyway. The lock is held for the process's life (the binding lives through the message loop).fzt-fileswith no command (with or without--start-dir), lockfzt-files. It is claimed after the arguments are read and before the log line, the window title and the terminal open, so a refused copy printsfzt-files is already openand exits 1 with the terminal untouched.fzt-files rename|move|copy|delete <path>andnew-folder [<in>](how another app gives one key to a command),help, and a bad--start-dir(still exit 1 with its own message).Both claims wait 5 s for a copy still ending (home-sync's restart, a
respawn-pane -kupdate of a manage files window).What it adds
one-copyv0.1.0 ingo.modand the injector'sCargo.toml(andCargo.lock).tools/hidden-desktop/hook_test.pyandswap_test.pystart their injectors under anONE_COPY_SCOPEof their own, so his running injector's lock doesn't refuse them;swap_test.py overlapgives the old and new injector different scopes so they still overlap, as its scenario needs.ONE_COPY_SCOPE=qain the fzt-files real terminal check, a one-copy check, the hook test's scope).What it leaves alone
The hook, shim, frontend DLL, standalone frontend and test-trigger are unchanged. Who starts the injector at sign-in (the Startup shortcut and home-sync's sign-in step) is home-sync's, not changed here; home-sync's kill-and-wait restart is romaine-life/at-home-tools PR 549.
Proof (nelsonpc)
A scratch program held the locks with
ONE_COPY_SCOPE=fp17test:fzt-files(no arguments, same scope):fzt-files is already open, exit 1 after 5 s; on a throwaway tmux server the pane showed that line and died with status 1.fzt-files rename <test file>while the lock was held: opened onrename a.txt to, Escape exited 130.fzt-files helpexited 0.fzt-filesopened the command list.FZT_PICKER_LOGin scratch): with the lock held, exit 0 after 8 s and its log's one lineinfo injector already running, so this one exits, noinjector hooked. Holder released: it passed the claim and stopped atfzt_picker_shim.dll not found, so no hook went in.ci-check: all 6 check jobs passed.hook_test.pyandswap_test.pywere not run: each installs a test injector's global hook, which takes an entry in this PC's hook DLL table (RLFP-1).