Skip to content

Fix the crash on a real Photos drag - #41

Merged
tsvb merged 1 commit into
mainfrom
claude/photos-drop-crash
Sep 14, 2026
Merged

tsvb merged 1 commit into
mainfrom
claude/photos-drop-crash

Conversation

@tsvb

@tsvb tsvb commented Sep 13, 2026

Copy link
Copy Markdown
Owner

The file-promise reader in ImageDrop.receive is main-actor isolated (the enum is @MainActor), but it was handed a private OperationQueue, so Swift 6's isolation check trapped the moment Photos delivered the file. The crash report from this morning's drag (LUTzy-2026-09-13-093026.ips) shows _swift_task_checkIsolatedSwift under the reader closure. The reader only yields into an AsyncStream, so it now runs on OperationQueue.main.

Follow-up to #37. Not reproducible in a unit test: only a live drag session vends an NSFilePromiseReceiver.

Test plan

  • ImageDropTests pass.
  • Drag one photo from Photos onto the preview: it opens instead of crashing.

🤖 Generated with Claude Code

https://claude.ai/code/session_01ViSYWttguWwFQm1PEksQ7K

`ImageDrop` is `@MainActor`, so the reader closure handed to
`receivePromisedFiles` is main-actor isolated; Swift 6 checks that when the
closure runs. Handed a private `OperationQueue`, the first real Photos drag
died in `dispatch_assert_queue` (LUTzy-2026-09-13-093026.ips). The reader
only yields into an `AsyncStream`, so it runs on `.main` now.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01ViSYWttguWwFQm1PEksQ7K
@tsvb
tsvb merged commit a66af75 into main Sep 14, 2026
2 checks passed
@tsvb
tsvb deleted the claude/photos-drop-crash branch September 14, 2026 00:05
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.

1 participant