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

Swift 6 and concurrency update #18

Merged
merged 7 commits into from
Oct 29, 2024
Merged

Swift 6 and concurrency update #18

merged 7 commits into from
Oct 29, 2024

Conversation

Cordavi
Copy link
Contributor

@Cordavi Cordavi commented Oct 24, 2024

What it Does

  • Updates Networking to have strict concurrency turned on as well as Swift 6
  • Goes through and conforms various types to Sendable

How I Tested

  • Built the app, ran the test repeatedly 100 times to make sure they pass
  • Tried using this update in Provider

Notes

  • There is an issue where if you call one of the combine based network calls from the main thread and then do things on any other thread as part of the returned combine chain, the app will crash without a compiler warning. Used @MainActor to enforce it being called from the thread and then always receiving on that thread. I can't scope it to something like the MainQueueScheduler we have in ViewStore, so I updated the docs to call it out.

Signed-off-by: Michael Amundsen <[email protected]>
Signed-off-by: Michael Amundsen <[email protected]>
Signed-off-by: Michael Amundsen <[email protected]>
Signed-off-by: Michael Amundsen <[email protected]>
Signed-off-by: Michael Amundsen <[email protected]>
@Cordavi Cordavi marked this pull request as ready for review October 24, 2024 19:52
@Cordavi Cordavi requested review from Pearapps and Twigz October 24, 2024 19:52
Comment on lines -25 to -29
public extension RequestBehavior {
func requestWillSend(request: inout URLRequest) { }
func requestDidFinish(result: Result<NetworkResponse, NetworkError>) { }
}

Copy link
Contributor Author

Choose a reason for hiding this comment

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

These seem to be the get called even when you conform the type which causes unexpected behavior. Removing them so you have to determine what you want.

Copy link
Member

Choose a reason for hiding this comment

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

Make sure we mark the next version as a new major version then, as this is a breaking change.

@Cordavi Cordavi merged commit bd7d435 into main Oct 29, 2024
@Cordavi Cordavi deleted the feature/swift-6 branch October 29, 2024 20:24
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