Repository navigation
Fix clipboard history startup race, image cleanup, and capture permissions - #19966
Conversation
[Medium impact] The changes since the previous review appear safe to merge. SummaryThe PR queues early captures, removes redundant history reloads, cleans up cached images, and tightens capture permissions. The latest changes:
No new actionable findings were accepted. Checks were based on source review; no tests were run. Reviews (2) · Last reviewed commit: "Guard pre-ready FileView signals and pre..." · Reviewed by Greptile |
… on out-of-order captures
|
Codex High reviewed The required second code review did not run: Opus 5.5 High hit its weekly usage limit, confirmed by the reviewer availability check. The image cleanup also overlaps #14266 and #14819, which use different implementations. This is waiting on a second review and the maintainer’s decision about combining those fixes. No code changes were pushed. |
Reclaim pre-existing orphaned files in clipboard-images/ (accumulated before #19966, left behind by legacy inode-less history entries, or orphaned by a crash) once on clipboard plugin initialization before watchers start. Serializes on the same .lock file as capture.sh, skips recent files, dotfiles, temp files, and symlinks, and bails out without deleting if clipboard-history.json is missing or unreadable. Co-authored-by: AnPod <[email protected]> Co-authored-by: JJDizz1L <[email protected]>
…sions (omacom#19966) * Fix clipboard history startup race, image cleanup, and capture permissions * Guard pre-ready FileView signals and preserve latest image generation on out-of-order captures
Reclaim pre-existing orphaned files in clipboard-images/ (accumulated before omacom#19966, left behind by legacy inode-less history entries, or orphaned by a crash) once on clipboard plugin initialization before watchers start. Serializes on the same .lock file as capture.sh, skips recent files, dotfiles, temp files, and symlinks, and bails out without deleting if clipboard-history.json is missing or unreadable. Co-authored-by: AnPod <[email protected]> Co-authored-by: JJDizz1L <[email protected]>
Fixes four issues in the clipboard plugin:
Clipboard.qmlpreviously startedcurrentProcand thewl-pastewatchers beforeFileViewfinished loadingclipboard-history.json, so an early capture could overwrite the file with only the new entry. Incoming captures before load are now queued and merged once history loads.Clipboard.qmlis the sole writer ofclipboard-history.json; removingwatchChangesavoids re-reading and re-parsing the full history on every own write or unrelated write under~/.local/state/omarchy/.historyLimitnow deletes unreferenced cached image files underclipboard-images/. Captures atomically replace files underflockand record their inode so a delayed prune never deletes a concurrently recaptured image of the same hash (and legacy entries without an inode are never unlinked unconditionally).clipboard-history.jsonat0600(unlinking symlinks first), enforceumask 077and0700onclipboard-images/incapture.sh, and reject non-alphanumeric image MIME subtypes to prevent path traversal.Verified by Codex