Skip to content

Remove the extension that makes NSDate ServerTimestampWrappable. #6247

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

Merged
merged 1 commit into from
Aug 10, 2020

Conversation

wilhuff
Copy link
Contributor

@wilhuff wilhuff commented Aug 10, 2020

This turns out not to actually work because NSDate does not conform to Codable. Users can supply their own extensions that make NSDate conform to Codable and also supply an extension like this one to make NSDate conform to ServerTimestampWrappable.

Add a test that verifies ServerTimestamps of Swift Date actually work. The equivalent test for NSDate does not compile.

This turns out not to actually work because NSDate does not conform to
Codable. Users can supply their own extensions that make NSDate conform
to Codable and also supply an extension like this one to make NSDate
conform to ServerTimestampWrappable.

Add a test that verifies ServerTimestamps of Dates actually work. The
equivalent test for NSDate does not compile.
@wilhuff
Copy link
Contributor Author

wilhuff commented Aug 10, 2020

Discovered while adding tests for the PR addressing #6237.

Copy link
Member

@ryanwilson ryanwilson left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice catch!

@wilhuff wilhuff merged commit c04334a into master Aug 10, 2020
@wilhuff wilhuff deleted the wilhuff/server-timestamp-nsdate branch August 10, 2020 22:51
@firebase firebase locked and limited conversation to collaborators Sep 10, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants