Closed Bug 1815226 Opened 2 years ago Closed 2 years ago

The Json parsed view incorrectly displays large numbers

Categories

(DevTools :: JSON Viewer, defect, P2)

Firefox 109
defect

Tracking

(Not tracked)

RESOLVED DUPLICATE of bug 1431808

People

(Reporter: David-Pannen, Unassigned, NeedInfo)

Details

Attachments

(3 files)

Attached file firefox_bug.json

User Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/109.0.0.0 Safari/537.36

Steps to reproduce:

Open the example JSON in Firefox and switch to JSON view.

Actual results:

Wrong numbers are displayed:
id1: 117410890614504780
id2: 117410890644643820

Expected results:

The correct numbers from the raw json are displayed:
id1: 117410890614504777
id2: 117410890644643827

Attached image Defective_View.png
Summary: The Json highlighting view incorrectly modifies large numbers → The Json highlighting view incorrectly displays large numbers
Summary: The Json highlighting view incorrectly displays large numbers → The Json parsed view incorrectly displays large numbers
OS: Unspecified → macOS
Hardware: Unspecified → x86_64

The Bugbug bot thinks this bug should belong to the 'DevTools::General' component, and is moving the bug to that component. Please correct in case you think the bot is wrong.

Component: Untriaged → General
Product: Firefox → DevTools

We use JSON.parse to get a representation for the json, and this will turn big integers into approximate values.
Note that you would get the same when using JSON.parse with such data, but maybe other languages handle this just fine.

We should check if using big numbers in JSON still is considered as valid JSON or if we should default to raw data for this. Otherwise we can try to find another way of parsing such JSON.

Severity: -- → S3
Status: UNCONFIRMED → NEW
Ever confirmed: true
Flags: needinfo?(jdescottes)
OS: macOS → All
Priority: -- → P2
Hardware: x86_64 → All
Component: General → JSON Viewer

There's a proposal to expose the raw text to a JSON.parse function so we could transform those numbers into BigInt (See Bug 1658310)

See Also: → 1658310
Status: NEW → RESOLVED
Closed: 2 years ago
Duplicate of bug: 1431808
Resolution: --- → DUPLICATE
See Also: 1658310
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: