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

feat!: remove deprecated timestampInSnapshots setting #808

Merged
merged 2 commits into from
Dec 9, 2019

Conversation

schmidt-sebastian
Copy link
Contributor

The next release will be breaking (see #805). I would like to use this opportunity to clean up the code and remove timestampInSnapshots

@googlebot googlebot added the cla: yes This human has signed the Contributor License Agreement. label Dec 6, 2019
@schmidt-sebastian schmidt-sebastian force-pushed the mrschmidt/deprecate branch 2 times, most recently from ea59a77 to 7114340 Compare December 6, 2019 16:55
@codecov
Copy link

codecov bot commented Dec 6, 2019

Codecov Report

Merging #808 into master will increase coverage by 0.01%.
The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #808      +/-   ##
==========================================
+ Coverage   74.22%   74.24%   +0.01%     
==========================================
  Files          50       50              
  Lines        2914     2904      -10     
  Branches      467      462       -5     
==========================================
- Hits         2163     2156       -7     
+ Misses        697      695       -2     
+ Partials       54       53       -1
Impacted Files Coverage Δ
dev/src/types.ts 100% <ø> (ø) ⬆️
dev/src/index.ts 96.96% <100%> (+1.12%) ⬆️
dev/src/serializer.ts 96.72% <100%> (-0.08%) ⬇️
dev/src/validate.ts 89.41% <0%> (-1.18%) ⬇️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 1f4eb0a...bc51b45. Read the comment docs.

@schmidt-sebastian schmidt-sebastian changed the title feat!: Remove deprecated timestampInSnapshots setting feat!: remove deprecated timestampInSnapshots setting Dec 6, 2019
Copy link
Contributor

@mikelehen mikelehen left a comment

Choose a reason for hiding this comment

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

LGTM with optional settings validation improvement request

// tslint:disable-next-line deprecation
settings.timestampsInSnapshots,
{optional: true}
);
Copy link
Contributor

Choose a reason for hiding this comment

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

Am I reading the code correctly that we don't have any particular validation to prevent "extra" settings? (i.e. if a user typos 'projectId' as 'projectID' we'll just silently ignore it rather than let them know that they messed up?)

It would be nice if we had validation like the web SDK (https://github.com/firebase/firebase-js-sdk/blob/57a0f2bd78afba64b292125522f1071b386a920d/packages/firestore/src/api/database.ts#L181) and then now that we remove timestampsInSnapshots, people will get a very clear error if they're using it.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

No, we don't have this validation. The Server SDK supports a ton of options that are consumed by either our code, Google Gax or GRPC. I would be surprised if anyone knew the complete set of settings we support, hence I don't think we can validate them here.

@schmidt-sebastian schmidt-sebastian merged commit f37fffc into master Dec 9, 2019
This was referenced Dec 9, 2019
@schmidt-sebastian schmidt-sebastian deleted the mrschmidt/deprecate branch January 3, 2020 00:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cla: yes This human has signed the Contributor License Agreement.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants