appwrite / sdk-generator

Generating SDKs for multiple programming languages and platforms ⚙️
https://appwrite.io
MIT License
272 stars 168 forks source link

Use `json-bigint` for Integer Parsing #920

Open ItzNotABug opened 2 months ago

ItzNotABug commented 2 months ago

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.)

stnguyen90 commented 2 months ago

@TorstenDittmann, you okay with taking this approach?

loks0n commented 1 month ago

Can you share more about the issue? What situation does it occur?

ItzNotABug commented 4 weeks ago

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.