Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix OpenURL crash on macOS Sequoia #305

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

beetee17
Copy link

Refer to the discussion at #301 for details.

@@ -12,7 +12,7 @@

@available(iOS 14, macOS 11, tvOS 14, watchOS 7, *)
private enum OpenURLKey: DependencyKey {
static let liveValue = OpenURLEffect { url in
static let liveValue = OpenURLEffect { @MainActor url in
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
static let liveValue = OpenURLEffect { @MainActor url in
// NB: This must be annotated '@MainActor' to avoid a Swift bug:
// https://github.com/pointfreeco/swift-dependencies/discussions/301
static let liveValue = OpenURLEffect { @MainActor url in

@stephencelis
Copy link
Member

@beetee17 Thanks, and sorry for the delay! This time of year has been busy.

Do you think it's possible to get a unit test in place that demonstrates the problem? Ideally we would have CI catch any regressions if someone were to refactor away that @MainActor annotation. I've at the very least added a suggestion to comment on the inclusion of it.

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