Skip to content

Commit 3f931f2

Browse files
陈一斌陈一斌
authored andcommitted
Fix Swift 6 file watcher teardown for releases
Move FileWatcher cleanup into the MainActor-isolated stop path so Swift 6 does not reject deinit access to non-Sendable Dispatch file system sources. Bump the app bundle version to 1.0.4 so the next release tag and packaged metadata stay aligned. Constraint: The GitHub release workflow is tag-driven, so the bundle version should match the new patch release Constraint: DispatchSourceFileSystemObject is not Sendable under Swift 6 checks in nonisolated deinit Rejected: Add @preconcurrency to Dispatch imports | it would only downgrade a real Swift 6 isolation issue into a warning Rejected: Leave version metadata at 1.0.3 | it would mismatch the new release tag users download Confidence: high Scope-risk: narrow Reversibility: clean Directive: Keep FileWatcher teardown on the main actor while it owns main-queue Dispatch sources Tested: swift build --disable-sandbox; swift build -c release --disable-sandbox Not-tested: Live GitHub Actions rerun of the macOS release workflow after tagging v1.0.4
1 parent d0285b6 commit 3f931f2

2 files changed

Lines changed: 4 additions & 4 deletions

File tree

SkillsManager/Info.plist

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,9 @@
1919
<key>CFBundlePackageType</key>
2020
<string>APPL</string>
2121
<key>CFBundleShortVersionString</key>
22-
<string>1.0.3</string>
22+
<string>1.0.4</string>
2323
<key>CFBundleVersion</key>
24-
<string>3</string>
24+
<string>4</string>
2525
<key>LSMinimumSystemVersion</key>
2626
<string>$(MACOSX_DEPLOYMENT_TARGET)</string>
2727
<key>NSHumanReadableCopyright</key>

SkillsManager/Services/FileWatcher.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,8 +46,8 @@ final class FileWatcher: ObservableObject {
4646
}
4747

4848
deinit {
49-
for source in sources {
50-
source.cancel()
49+
MainActor.assumeIsolated {
50+
stopAll()
5151
}
5252
}
5353
}

0 commit comments

Comments
 (0)