Open AlTensor opened 3 years ago
I found a few problems with this issue:
As far as I can tell,@DocumentID
does not currently conform to the requirements of @Sendable
as it contains mutable state. We can address this shortly.
Any updates on this being added?
@wu-hui friendly bump : ) Btw, I was wondering, are there plans to rewrite Firebase Swift SDK in the Swift language?
Thanks for the reminder. Unfortunately we have not found time for this, and still do not know when we can get to this.
Can't this at least be partially completed for String
-based @DocumentID
s? I could be wrong (I don't have a project up to test this out), but couldn't you add something like this to the DocumentID file?
public extension DocumentID: Sendable where Value == String {}
I know it's more involved to add Sendable
conformance to DocumentReference
, but when @DocumentID
is just wrapping the document ID String
, Sendable
conformance shouldn't be too involved.
The @DocumentID property wrapper for Firestore does not conform to the concurrency protocol Sendable in the upcoming Swift 5.5. Conformance to Sendable will be very important for types that need to be used with Actors. This document provides more details: https://github.com/apple/swift-evolution/blob/main/proposals/0302-concurrent-value-and-concurrent-closures.md
We can override the compiler with @unchecked annotation on the type but I'm hesitant to do that without a confirmation that @DocumentID can in fact be safely Sendable