Skip to content

Commit 3cf633a

Browse files
authored
Fix issue with weak let in Sendable AirDatabaseGroup (#175)
1 parent 7bc4335 commit 3cf633a

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

Sources/PowerSync/Implementation/ActiveInstanceStore.swift

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,9 +44,10 @@ private final class ActiveDatabaseGroupData: Sendable {
4444
/// Additionally, we want to avoid two databases in the same group having a sync stream open at the same time to avoid
4545
/// duplicate resources being used. For this reason, each active database group has a single sync coordinator actor
4646
/// responsible for initializing the sync process for all databases in the group.
47-
final class ActiveDatabaseGroup: Sendable {
47+
final class ActiveDatabaseGroup: @unchecked Sendable {
48+
// unchecked sendable because we need to use weak var (our minimum Swift version is 6.1, weak let was introduced in 6.3).
4849
fileprivate let data: ActiveDatabaseGroupData
49-
private weak let collection: DatabaseGroupCollection?
50+
private weak var collection: DatabaseGroupCollection?
5051

5152
fileprivate init(data: ActiveDatabaseGroupData, collection: DatabaseGroupCollection) {
5253
self.data = data

0 commit comments

Comments
 (0)