Use `json-bigint` for Integer Parsing
What does this PR do?
Fixes the issue where the big integers are incorrect due to precision loss.
Test Plan
(Write your test plan here. If you changed any code, please provide us with clear instructions on how you verified your changes work.)
Related PRs and Issues
(If this PR is related to any other PR or resolves any issue or related to any issue link all related PR and issues here.)
Have you read the Contributing Guidelines on issues?
(Write your answer here.)
@TorstenDittmann, you okay with taking this approach?
Can you share more about the issue? What situation does it occur?
Can you share more about the issue? What situation does it occur?
The values returned on console are different for min/max due to how PHP and JS round off the int/big int. Values should be -
-9223372036854775808 & 9223372036854775807 but JS rounds off to -9223372036854776000 and -9223372036854776000. This causes issues during updates iirc.
Fixes the issue where the big integers are incorrect due to precision loss.
Does these changes affect how the Console repo parses the number it receives from the backend? I ask, because in Console we are already receiving the correct number from the backend via JSON - but it is only after it parses it into a number object it gets rounded to an incorrect amount causing this issue.
Ref: https://github.com/appwrite/console/issues/1473
Fixes the issue where the big integers are incorrect due to precision loss.
Does these changes affect how the Console repo parses the number it receives from the backend? I ask, because in Console we are already receiving the correct number from the backend via JSON - but it is only after it parses it into a
numberobject it gets rounded to an incorrect amount causing this issue.
Yeah, the console SDK is generated using the web sdk with a few extra endpoints
@loks0n based on the new changes, we could either use that impl or might add a library to handle this scenario. CLI anyway uses the same library used previously to handle this scenario.
cc @TorstenDittmann.