[Bug]: Web Studio JSON preview rounds large integers and replaces large exponents with null

Open Beginner friendly
#8,432 0 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

Difficulty
2/5
Estimated time
1-3 hours
Newbie friendliness
62/100
Issue type
Bug
Clarity
Clearly specified
Activity status
Active
Tech stack
javascript, json, typescript
Domain
frontend

Research direction

The bug lives in formatJsonContent in web-studio/src/features/workbench/resources/lib/json-format.ts, which parses and reserializes JSON through JavaScript numbers. Start by reading that function and reproducing the minimal example {"id":9007199254740993,"scale":1e400} with Node. Done means the default Preview keeps the original numeric text for large integers and large exponents while still adding indentation, and a normal value like 42 still formats as before.

Written by the indexing model from the issue text.

Description

Issue Origin

Observed in Web Studio’s production JSON preview formatter on the current main branch.

Bug Description

The default preview parses and reserializes JSON through JavaScript numbers. A valid large integer can display as a different ID, and a valid large exponent can appear as null. Source view keeps the original text.

Steps to Reproduce
  1. Open a JSON resource with the content below in Web Studio.
  2. Compare the default Preview view with Source.
  3. For an isolated reproduction, pass the same text to formatJsonContent in web-studio/src/features/workbench/resources/lib/json-format.ts.
Expected Behavior

Preview adds indentation while preserving 9007199254740993 and 1e400.

Actual Behavior

The formatter produces 9007199254740992 for the ID and null for the exponent. A normal ID such as 42 formats as expected.

Minimal Reproducible Example
{"id":9007199254740993,"scale":1e400}
OpenViking Version

Main branch formatter blob 60606becc14d13d05e709eccf6c227552f609fae.

Python Version

Not used in this frontend reproduction.

Operating System

Windows.

Model Backend

Other (not involved).

Additional Context

Reproduced by executing the exact TypeScript formatter with Node.js 24 on Windows. The current worker calls this formatter directly. The browser was not run for this reproduction.

Dominant language
Python
Stars
42.6k
Forks
3.6k
Avg merge
15h 24m
Merged PRs (30d)
547

Getting set up

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from volcengine/OpenViking

All issues in volcengine/OpenViking

Similar issues

More Python issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.