Skip to content

Flush clipboard history before quit#6

Open
sickn33 wants to merge 1 commit into
chenyuxiaojin:mainfrom
sickn33:flush-clipboard-history-saves
Open

Flush clipboard history before quit#6
sickn33 wants to merge 1 commit into
chenyuxiaojin:mainfrom
sickn33:flush-clipboard-history-saves

Conversation

@sickn33

@sickn33 sickn33 commented Jun 29, 2026

Copy link
Copy Markdown

Summary

  • add ClipboardMonitor.flushPendingSave() to synchronously persist the latest in-memory history
  • call the flush path during applicationWillTerminate
  • move debounced writes onto a serial save queue and add a temp-file-backed test

Why

Clipboard history saves are debounced by 0.5 seconds. If the app exits immediately after a history change, the pending DispatchWorkItem may never get a chance to write the latest state. This makes quit/terminate behavior deterministic without removing the debounce during normal use.

Verification

  • git diff --check
  • xcodebuild test -project DropKit/DropKit.xcodeproj -scheme DropKit -destination 'platform=macOS' -derivedDataPath /private/tmp/dropkit-flush-derived CODE_SIGNING_ALLOWED=NO passed 12 tests, 0 failures

@sickn33 sickn33 force-pushed the flush-clipboard-history-saves branch 2 times, most recently from 17e6555 to 63e87ce Compare June 29, 2026 15:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants