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

ServerTimestamp<T> could be sendable if T is Sendable #14042

Closed
jesus-mg-ios opened this issue Nov 6, 2024 · 6 comments · Fixed by #14162
Closed

ServerTimestamp<T> could be sendable if T is Sendable #14042

jesus-mg-ios opened this issue Nov 6, 2024 · 6 comments · Fixed by #14162

Comments

@jesus-mg-ios
Copy link

Description

ServerTimestamp is not sendable, while T generic parameter like Date could be sendable.

Reproducing the issue

No response

Firebase SDK Version

11.2.0

Xcode Version

16.1

Installation Method

Swift Package Manager

Firebase Product(s)

Firestore

Targeted Platforms

iOS

Relevant Log Output

.

If using Swift Package Manager, the project's Package.resolved

No response

If using CocoaPods, the project's Podfile.lock

No response

@google-oss-bot
Copy link

I couldn't figure out how to label this issue, so I've labeled it for a human to triage. Hang tight.

@milaGGL
Copy link
Contributor

milaGGL commented Nov 7, 2024

Hi @jesus-mg-ios, thank you for raising this issue. Could you please provide more details on it?

@jesus-mg-ios
Copy link
Author

jesus-mg-ios commented Nov 7, 2024

Sure, imagine that you got a variable var serverTimestamp: ServerTimestamp<Date> to decode a response using Firestore, then ServerTimestamp is marked as Non Sendable ...

So it would be nice, that if Date, (that it is ) is sendable, then ServerTimestamp could be Sendable

Something like this extension ServerTimestamp: Sendable where T: Sendable {} Because in this case ServerTimestamp can be Sendable if T it is. @milaGGL

@milaGGL
Copy link
Contributor

milaGGL commented Nov 11, 2024

Hi @jesus-mg-ios, improving Sendable conformance in the SDK is certainly on our radar, but it is deprioritized for now. I've added your request to our backlog so we can consider it for future development. Googlers please see b/378477431.

Thank you again for bringing this to our attention. I'll close the issue for now and will update it if there are any changes.

@paulb777
Copy link
Member

Reopening since we are investigating better Swift Concurrency support across Firebase and we can consider this request in that effort.

@ncooke3
Copy link
Member

ncooke3 commented Nov 22, 2024

@jesus-mg-ios, thanks again for the report! This will go out in the next release. I'll be continuing to improve the Swift 6 experience in future releases (e.g. #14163, etc.).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment