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

Always serialize float fields in exponent notation #13317

Closed
dpetrick opened this issue May 12, 2022 · 0 comments · Fixed by #15879
Closed

Always serialize float fields in exponent notation #13317

dpetrick opened this issue May 12, 2022 · 0 comments · Fixed by #15879
Labels
bug/2-confirmed Bug has been reproduced and confirmed. kind/bug A reported bug. team/client Issue for team Client. tech/typescript Issue for tech TypeScript.
Milestone

Comments

@dpetrick
Copy link
Contributor

Follow-up to this ticket: #12651
We should always serialize float field values in the generated GraphQL query to exponential notation, as the whole number serialization causes the value being parsed as a 64 bit signed integer, which limits the float range unnecessarily.

I consider this a bug as the user has a valid float to store, but the integer parsing prevents that.

@dpetrick dpetrick added bug/2-confirmed Bug has been reproduced and confirmed. kind/bug A reported bug. tech/typescript Issue for tech TypeScript. team/client Issue for team Client. size/s labels May 12, 2022
cmd-johnson added a commit to cmd-johnson/prisma that referenced this issue Oct 19, 2022
SevInf added a commit that referenced this issue Oct 19, 2022
* test(client): unit test for #12651

* test(client): integration test for #12651

* fix(client): Serialize all floats in exponential notation

Fix #12651, fix #13317

* test(internals): Fix normalizeMigrateTimestamps applying to all long numbers

* test(client): Convert large-floats tests to functional

* test(client): Revert snapshot serializer changes

It does not seem that it was indendened for snapshot serizier to apply
to select.test.ts. Instead, we are fixing the failure by changing the
number so it won't be replaced by serializer.

* Revert "test(client): Revert snapshot serializer changes"

This reverts commit 7756be2.

* Update packages/internals/src/utils/jestSnapshotSerializer.js

Co-authored-by: Sergey Tatarintsev <sergey@tatarintsev.me>
Co-authored-by: Alexey Orlenko <alex@aqrln.net>
@janpio janpio added this to the 4.6.0 milestone Oct 19, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug/2-confirmed Bug has been reproduced and confirmed. kind/bug A reported bug. team/client Issue for team Client. tech/typescript Issue for tech TypeScript.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants