Skip to content

Commit

Permalink
Merge branch 'main' into feature/spezi-account-2.0
Browse files Browse the repository at this point in the history
  • Loading branch information
Supereg committed Aug 2, 2024
2 parents 55c9a32 + e381b7d commit 982d664
Showing 1 changed file with 8 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -170,8 +170,10 @@ public actor FirestoreAccountStorage: AccountStorageProvider { // TODO: complete
do {
switch result {
case let .success(data):
try await userDocument(for: accountId)
.setData(data, merge: true)
if !data.isEmpty {
try await userDocument(for: accountId)
.setData(data, merge: true)

Check warning on line 175 in Sources/SpeziFirebaseAccountStorage/FirestoreAccountStorage.swift

View workflow job for this annotation

GitHub Actions / Build and Test Swift Package / Test using xcodebuild or run fastlane

passing argument of non-sendable type 'FirestoreEncodeVisitor.Data' (aka 'Dictionary<String, Any>') outside of actor-isolated context may introduce data races
}
case let .failure(error):
throw error
}
Expand All @@ -180,8 +182,10 @@ public actor FirestoreAccountStorage: AccountStorageProvider { // TODO: complete
result[key.identifier] = FieldValue.delete()
}

try await userDocument(for: accountId)
.updateData(removedFields)
if !removedFields.isEmpty {
try await userDocument(for: accountId)
.updateData(removedFields)

Check warning on line 187 in Sources/SpeziFirebaseAccountStorage/FirestoreAccountStorage.swift

View workflow job for this annotation

GitHub Actions / Build and Test Swift Package / Test using xcodebuild or run fastlane

passing argument of non-sendable type '[String : Any]' outside of actor-isolated context may introduce data races
}
} catch {
throw FirestoreError(error)
}
Expand Down

0 comments on commit 982d664

Please sign in to comment.