Skip to content

Conversation

@brnnmrls
Copy link
Member

@brnnmrls brnnmrls commented Apr 30, 2025

Our current implementation of sending a NSMutableURLRequest in a DispatchQueue.main.async gives a warning that will be an error in Swift 6:

Capture of 'request' with non-sendable type 'NSMutableURLRequest' in a `@Sendable` closure; this is an error in the Swift 6 language mode

Swift 6 suggests that sending in an object that does not conform to the Sendable protocol is unsafe when dealing with multiple threads, so this PR suggests a switch to use URLRequest which does conform to the Sendable protocol.

Fixes #249

@brnnmrls brnnmrls requested a review from yalkhder April 30, 2025 20:41
@brnnmrls brnnmrls marked this pull request as ready for review April 30, 2025 20:41
@brnnmrls brnnmrls merged commit ed0c94d into master Apr 30, 2025
6 checks passed
@brnnmrls brnnmrls deleted the briannamorales/fix-sendable-warning branch April 30, 2025 23:37
@brnnmrls brnnmrls mentioned this pull request Apr 30, 2025
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.

MacOS warning

2 participants