Skip to content

fix(csv): keep document opening on the main actor - #2600

Open
salmonumbrella wants to merge 1 commit into
TableProApp:mainfrom
salmonumbrella:fix/csv-document-concurrent-reading
Open

fix(csv): keep document opening on the main actor#2600
salmonumbrella wants to merge 1 commit into
TableProApp:mainfrom
salmonumbrella:fix/csv-document-concurrent-reading

Conversation

@salmonumbrella

Copy link
Copy Markdown
Contributor

What changed

  • Keep CSV and TSV document opening on AppKit's main actor by inheriting NSDocument's default serial-read behavior.
  • Add a regression test covering both advertised CSV and TSV document types.
  • Record the macOS 27 crash fix in the changelog.

Why

Opening a CSV or TSV on macOS 27 can terminate TablePro with EXC_BREAKPOINT / SIGTRAP, with _dispatch_assert_queue_fail and _swift_task_checkIsolatedSwift reached from the NSDocumentController opening queue. Under Swift 6, NSDocument is main-actor isolated, but CSVDocument opted into concurrent reads, allowing AppKit to open it on a background queue. Removing that override restores the framework default and keeps document construction and reading on the actor AppKit requires. This matches the underlying AppKit concurrency issue tracked in Apple Feedback #38.

Usage

No usage change.

Verification

  • git diff --check origin/main..HEAD: pass.
  • Roborev reviewed the final commit; the correctness fix and regression coverage were accepted.
  • Xcode build, test execution, and manual macOS 27 verification were not run because this work was completed on Linux. CI or a macOS checkout still needs to open a sanitized CSV and TSV before merge.

Serial document opening can make existing up-front row indexing visible on the main actor for very large files. Moving that indexing behind an async boundary is separate work; this PR restores actor correctness without widening scope.

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