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

fix: Store large numbers as doubles #683

Merged
merged 4 commits into from
Jun 5, 2019
Merged

Conversation

thebrianchen
Copy link

@thebrianchen thebrianchen commented Jun 5, 2019

@googlebot googlebot added the cla: yes This human has signed the Contributor License Agreement. label Jun 5, 2019
@codecov
Copy link

codecov bot commented Jun 5, 2019

Codecov Report

Merging #683 into master will decrease coverage by 0.16%.
The diff coverage is 73.33%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #683      +/-   ##
==========================================
- Coverage   96.22%   96.06%   -0.17%     
==========================================
  Files          20       20              
  Lines        2227     2238      +11     
  Branches      470      475       +5     
==========================================
+ Hits         2143     2150       +7     
- Misses         20       21       +1     
- Partials       64       67       +3
Impacted Files Coverage Δ
dev/src/serializer.ts 93.7% <100%> (ø) ⬆️
dev/src/util.ts 87.09% <63.63%> (-12.91%) ⬇️

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 d15f29d...054ae80. Read the comment docs.

@codecov
Copy link

codecov bot commented Jun 5, 2019

Codecov Report

Merging #683 into master will not change coverage.
The diff coverage is 100%.

Impacted file tree graph

@@           Coverage Diff           @@
##           master     #683   +/-   ##
=======================================
  Coverage   96.22%   96.22%           
=======================================
  Files          20       20           
  Lines        2227     2227           
  Branches      470      470           
=======================================
  Hits         2143     2143           
  Misses         20       20           
  Partials       64       64
Impacted Files Coverage Δ
dev/src/serializer.ts 93.7% <100%> (ø) ⬆️

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 d15f29d...c0acc9f. Read the comment docs.

Copy link
Contributor

@schmidt-sebastian schmidt-sebastian left a comment

Choose a reason for hiding this comment

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

This does "right thing", but I think it could be simpler if you took advantage of the ES6 features we get from Node: https://node.green/#ES2015-built-in-extensions-Number-properties-Number-isSafeInteger

Remember to use "conventional commits" in your PR description and in your final commit message. This could be a "fix: Store large numbers as doubles".

Speaking of fixing, you are not just addressing firebase/firebase-admin-node#548, you are fixing it to. If you use one of the following keywords, the original issue will be auto-closed: https://help.github.com/en/articles/closing-issues-using-keywords

You also need to use the "fully-qualified" name of the issue (include firebase/firebase-admin-node), since you are referring to a different Repo. #number with no repo name always refers to the current repository.

dev/test/document.ts Show resolved Hide resolved
dev/src/serializer.ts Outdated Show resolved Hide resolved
dev/src/util.ts Outdated Show resolved Hide resolved
@thebrianchen thebrianchen changed the title Store large numbers as doubles fix: Store large numbers as doubles Jun 5, 2019
@schmidt-sebastian schmidt-sebastian merged commit 607b3c0 into master Jun 5, 2019
@schmidt-sebastian schmidt-sebastian deleted the bc/huge-nums branch June 5, 2019 23:27
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.

Firestore numbers greater than 2^53 are all stored as 9223372036854776000
3 participants