Repository navigation
Conversation
The closure handed to `backgroundQueue.schedule` is non-Sendable, so under
Swift 6 it inherits the enclosing `MainActor` isolation and the compiler
emits an executor check at its entry. It then runs on `backgroundQueue`,
where that check fails -- on Xcode 26.6 the app traps about two seconds
after launch:
_dispatch_assert_queue_fail
swift_task_isCurrentExecutorWithFlagsImpl
closure MythicApp#1 in SparkleUpdateController.manageBackgroundTask(_:)
Marking it `@Sendable` makes it properly non-isolated. The hop to the main
actor is the `Task` inside it, which is where the hop belongs -- so this is
a correctness fix regardless of whether a given toolchain turns the check
into a trap or a warning.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This was referenced Aug 21, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The closure handed to
backgroundQueue.scheduleis non-Sendable, so under Swift 6 it inherits the enclosingMainActorisolation and the compiler emits an executor check at its entry. It then runs onbackgroundQueue, where that check fails.On Xcode 26.6 the app traps roughly two seconds after launch:
Marking it
@Sendablemakes it properly non-isolated. The hop to the main actor is theTaskinside it, which is where the hop belongs — so this is a correctness fix regardless of whether a given toolchain turns that check into a trap or a warning.The usual workaround,
SWIFT_IS_CURRENT_EXECUTOR_LEGACY_MODE_OVERRIDE=legacy, downgrades every executor assertion in the process to a warning, which hides real isolation bugs while testing.