Skip to content

19-bit Long type digital precision lost #7623

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

Closed
Mr-LiuDC opened this issue Nov 12, 2019 · 2 comments
Closed

19-bit Long type digital precision lost #7623

Mr-LiuDC opened this issue Nov 12, 2019 · 2 comments

Comments

@Mr-LiuDC
Copy link

Describe the bug
Here is a problem that seems to exist in all JavaScript libraries. My ID is a 19-bit Long number generated by the Snowflake algorithm. When I click on the Beauty button, it also loses precision when it beautifies my Json.

To Reproduce
Steps to reproduce the behavior:

  1. Open Postman and send a request,POST or PUT.
  2. The parameter is row body like below:
{
    "startTime": 1571714270409,
    "userId": 1192715994825625600,
    "assessmentProcessId": 1194137245683023872,
    "assessmentDataDetails": [
        {
            "assessmentId": 1191185031834370048,
            "dataType": [
                "questionnaire"
            ],"questionnairePostData": [
                {
                    "questionnaireId": 1191185031880507392,
                    "tag": {
                        "squatOnTheWallCount": "115"
                    }
                }
            ],
            "heartRates": [
              
            ]
        }
    ]
}
  1. When I click the beauty button,the row body has changed, Looking at assessmentProcessId and assessmentId,it lost precision.
{
    "startTime": 1571714270409,
    "userId": 1192715994825625600,
    "assessmentProcessId": 1194137245683024000,
    "assessmentDataDetails": [
        {
            "assessmentId": 1191185031834370000,
            "dataType": [
                "questionnaire"
            ],
            "questionnairePostData": [
                {
                    "questionnaireId": 1191185031880507400,
                    "tag": {
                        "squatOnTheWallCount": "115"
                    }
                }
            ],
            "heartRates": []
        }
    ]
}

Expected behavior
Expect digital precision not to be lost.

App information (please complete the following information):

  • Postman Version 7.11.0 win32 10.0.16299 / x64
  • OS: Windows 10 Professional
@shamasis
Copy link
Member

Yep. That’s right. We currently need to parse the JSON to beautify and underlying limitations of number precision gets in the way here.

We are working towards solving this. cc @kamalaknn @postmanlabs/runtime

@codenirvana
Copy link
Member

Duplicate of #5658

@codenirvana codenirvana marked this as a duplicate of #5658 Nov 19, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants