-
Notifications
You must be signed in to change notification settings - Fork 220
Swift 6: complete concurrency checking (LLC and UIKit) #3661
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
base: develop
Are you sure you want to change the base?
Conversation
# Conflicts: # Sources/StreamChat/WebSocketClient/BackgroundTaskScheduler.swift
# Conflicts: # Sources/StreamChat/Models/CurrentUser.swift # Sources/StreamChat/Workers/CurrentUserUpdater.swift
Generated by 🚫 Danger |
if: ${{ github.event.inputs.record_snapshots != 'true' }} | ||
# if: ${{ github.event.inputs.record_snapshots != 'true' }} | ||
if: false # disable Xcode 15 builds |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Disabled Xcode 15 builds (it is hard to support it when complete concurrency checking is enabled). Hard means avoiding compiler crashes.
SDK Size
|
@@ -26,7 +26,7 @@ final class StreamAudioWaveformAnalyser: AudioAnalysing { | |||
private let audioSamplesExtractor: AudioSamplesExtractor | |||
private let audioSamplesProcessor: AudioSamplesProcessor | |||
private let audioSamplesPercentageNormaliser: AudioValuePercentageNormaliser | |||
private let outputSettings: [String: Any] | |||
nonisolated(unsafe) private let outputSettings: [String: Any] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nonisolated(unsafe)
because value is Any
SDK Performance
|
|
||
import Foundation | ||
|
||
/// Erase type for structs which recursively contain themselves. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It is easier to use a type instead of a closure when dealing with Sendable.
@@ -131,15 +131,19 @@ open class StreamAudioPlayer: AudioPlaying, AppStateObserverDelegate { | |||
open func play() { | |||
do { | |||
try audioSessionConfigurator.activatePlaybackSession() | |||
player.play() | |||
MainActor.ensureIsolated { | |||
player.play() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Note that AVPlayer and some asset related methods require main actor
|
||
// MARK: - | ||
|
||
private static let queue = DispatchQueue(label: "io.getstream.stream-runtime-check", target: .global()) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Alternative is to skip using queue here and making everything nonisolated(unsafe), especially because these are internal runtime checkes.
|
Important
StreamChatUI changes are in #3660 and will be merged to here. This PR can be reviewed already.
🔗 Issue Links
Resolves IOS-735
🎯 Goal
📝 Summary
Sendable
conformance to types@Sendable
to completion handlers@unchecked Sendable
types (internal classes have manual handling and found many which did not guard that state properly)@Sendable
to completion handlers creates warnings at callsites)🛠 Implementation
🧪 Manual Testing Notes
Manual regression testing round when UIKit changes are merged into this branch.
☑️ Contributor Checklist
docs-content
repo