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

Handling json with long numbers #740

Conversation

Assem-Hafez
Copy link
Contributor

Summary

Parsing JSON strings that includes long numbers was being rounded which results in showing inaccurate numbers back to the user. To solve this we are using a custom JSON parser/stringfier which is responsible of parsing long numbers into BigInt and back to a JSON string.

Changes

  • Install lossless-json library which allows custom parsing logic
  • create custom JSON parsing/stringifing utils
  • use the custom parser for any any JSON strings that is representing user code input/result

Next steps

  • Since now we are using BigInt to move long numbers between the code, displaying this value in the JSON viewer is show them postfixed with n for example 123849843754395n. I opened an issue in react-json-view-lite to discuss that.
  • Workflow queries may also include large numbers, going to raise a separate issue for it as it requires changing query/stacktrace pages.

@Assem-Uber Assem-Uber merged commit 58f2b1b into cadence-workflow:release/4.0.0 Nov 25, 2024
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants