Commit 30eef70
stickies-claude: single-instance lock kills duplicate-dispatch race
AppleToolbox fires the watcher from BOTH a 1.5s poll AND an FSEvents
source on the Stickies dir. FSEvents fires multiple times for a single
sticky save (one event per file inside the .rtfd bundle), so two
watcher processes can race the same uuid: both read the sticky, both
compute the same hash, both see "hash != state_file", both dispatch →
two iTerm windows.
Add an mkdir-based atomic lock at $STATE_DIR/.lock with a 60s
stale-lock steal. Verified with 10 parallel invocations: 1 runs, 9 log
"already running; skipping" and exit cleanly.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>1 parent 9c84364 commit 30eef70
1 file changed
Lines changed: 20 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
32 | 32 | | |
33 | 33 | | |
34 | 34 | | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
35 | 55 | | |
36 | 56 | | |
37 | 57 | | |
| |||
0 commit comments