Skip to content

Comments

Avoid truncation of large integers#371

Draft
janfh wants to merge 4 commits intocodefori:mainfrom
janfh:fix/bigint_reviver
Draft

Avoid truncation of large integers#371
janfh wants to merge 4 commits intocodefori:mainfrom
janfh:fix/bigint_reviver

Conversation

@janfh
Copy link
Contributor

@janfh janfh commented Apr 16, 2025

Fixes #324

Alternative fix to avoid truncation. Requires node >= 21.

  • Wait until VSCode with Electron 35 and node v22 is released
  • Test changes

Update of Electron and Node can be tracked here:
https://redirect.github.com/microsoft/vscode/pull/245423
https://redirect.github.com/microsoft/vscode/issues/250125

Background:

JSON.parse will parse integers to Number (IEEE 754 64-bit float) and is limited to values less than what might be returned from the server. This will cause truncation of values less than -9007199254740991 and greater than 9007199254740991 (Number.MAX_SAFE_INTEGER).

@janfh
Copy link
Contributor Author

janfh commented Jun 12, 2025

VSCode May 2025 release (v1.101):
In this milestone, we are promoting the Electron 35 update to users on our Stable release. This update comes with Chromium 134.0.6998.205 and Node.js 22.15.1.

@worksofliam
Copy link
Member

Nice, in this PR then, we should also bump the engine version in the package.json since this will only work in the newest versions of VS Code

@worksofliam
Copy link
Member

@janfh Is this PR ready for review?

@SanjulaGanepola
Copy link
Member

@janfh Can you check out the proposed fix in #481 which ends up using the json-bigint package. It should also address #324. Shall we go with that as it does not require specifically node >= 21.

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.

Big number and DB2 for i

3 participants