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

Web UI cannot handle numbers larger than Number.MAX_SAFE_INTEGER in JSON files #857

Open
KarboniteKream opened this issue Jul 24, 2023 · 3 comments
Labels
Milestone

Comments

@KarboniteKream
Copy link
Member

KarboniteKream commented Jul 24, 2023

If I try to create a JSON file, where a field has the value 9223372036854775807 (Long.MAX_VALUE), the UI displays it as 9223372036854776000.

Editing the file to replace this value with the original number displays the error You did not change anything when trying to save it. If I try to update the value with Long.MAX_VALUE - 1, the value is updated correctly (verified by looking at the API response), but the UI still displays 9223372036854776000.

It seems like this is caused by the value using JavaScript's Number instead of BigInt. I'm not sure this is a problem with the Central Dogma UI or some library it's using.

You can reproduce it by creating a file with the following contents:

{
  "test": 9223372036854775807
}

YAML files are unaffected:

test: 9223372036854775807
@KarboniteKream
Copy link
Member Author

Interestingly, Firefox itself has the same issue when rendering fields in JSON responses:

image image

@KarboniteKream
Copy link
Member Author

KarboniteKream commented Jul 24, 2023

It seems like BigInt is not commonly supported (even Axios parses big integers in API responses incorrectly), so this could be difficult to solve properly.

References:

@ikhoon
Copy link
Contributor

ikhoon commented Jul 25, 2023

Let me check BigInt problem in the new webapp and fix the issue there if the new webapp can't handle big nubmers.

@ikhoon ikhoon added the defect label Jul 25, 2023
@ikhoon ikhoon added this to the revamp-webapp milestone Jul 25, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants