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 #22

Merged
merged 16 commits into from
Nov 7, 2024
Merged

Swift 6 and Concurrency update #22

merged 16 commits into from
Nov 7, 2024

Conversation

Cordavi
Copy link
Contributor

@Cordavi Cordavi commented Oct 29, 2024

What it Does

  • Updates Provider to have strict concurrency turned on as well as Swift 6
  • Goes through and conforms various types to Sendable
  • Uses nonisolated(unsafe) and then manually manages the thread safety when needed for mutability.

How I Tested

  • Built the app, ran the test repeatedly 100 times to make sure they pass

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.
  • Most of the places we are using nonisolated(unsafe) we likely should move from classes to actors so that their mutable state is thread safe without managing it ourselves.
  • That felt like a bigger change so will be a follow refactor

Signed-off-by: Michael Amundsen <michaelamundsen@gmail.com>
Signed-off-by: Michael Amundsen <michaelamundsen@gmail.com>
Signed-off-by: Michael Amundsen <michaelamundsen@gmail.com>
Signed-off-by: Michael Amundsen <michaelamundsen@gmail.com>
Signed-off-by: Michael Amundsen <michaelamundsen@gmail.com>
Signed-off-by: Michael Amundsen <michaelamundsen@gmail.com>
Signed-off-by: Michael Amundsen <michaelamundsen@gmail.com>
Signed-off-by: Michael Amundsen <michaelamundsen@gmail.com>
@Cordavi Cordavi requested review from Twigz and removed request for Twigz October 29, 2024 19:05
Signed-off-by: Michael Amundsen <michaelamundsen@gmail.com>
Signed-off-by: Michael Amundsen <michaelamundsen@gmail.com>
@Cordavi Cordavi marked this pull request as ready for review October 30, 2024 18:06
@Cordavi Cordavi requested review from Twigz and Pearapps October 30, 2024 18:06
Signed-off-by: Michael Amundsen <michaelamundsen@gmail.com>
Signed-off-by: Michael Amundsen <michaelamundsen@gmail.com>
Signed-off-by: Michael Amundsen <michaelamundsen@gmail.com>
Tests/ItemProviderTests.swift Outdated Show resolved Hide resolved
Sources/Provider/ItemProvider.swift Outdated Show resolved Hide resolved
Sources/Provider/ItemProvider.swift Show resolved Hide resolved
Signed-off-by: Michael Amundsen <michaelamundsen@gmail.com>
Signed-off-by: Michael Amundsen <michaelamundsen@gmail.com>
@Cordavi Cordavi requested a review from Twigz October 31, 2024 17:29
Signed-off-by: Michael Amundsen <michaelamundsen@gmail.com>
@Cordavi Cordavi removed the request for review from Pearapps November 7, 2024 16:39
@Cordavi Cordavi merged commit ffcbb02 into main Nov 7, 2024
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