Skip to content

[Bug]: Fauxton silently corrupts integers larger than Number.MAX_SAFE_INTEGER #6008

Description

@mhehle

Version

3.3.3

Describe the problem you're encountering

Documents containing integers larger than JavaScript Number.MAX_SAFE_INTEGER are stored correctly by CouchDB itself.

However, when such a document is opened and saved through the Fauxton Web UI, the integer is silently rounded/truncated due to JavaScript number precision limits, corrupting the document.

Expected Behaviour

The integer value should remain unchanged after editing/saving via Fauxton.

Steps to Reproduce

  1. Insert a document containing a large integer:
{
  "_id": "large-int-test",
  "hugeNumber": 9223372036854775807
}
  1. Open the document in Fauxton.
  2. Save the document.
  3. Fetch the document again.

Actual Result

{
  "_id": "large-int-test",
  "_rev": "1-242234d64bf45499ef1d622e1a0f8237",
  "hugeNumber": 9223372036854776000
}

Your Environment

No response

Additional Context

No response

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions