Flagsmith / Flagsmith/flagsmith

frontend: 64bit id fields are truncated when cast to number type

Open
#5,915 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Python
Stars
6.6k
Forks
567
Avg merge
1d 13h
Merged PRs (30d)
121

Description

### How are you running Flagsmith

- [ ] Self Hosted with Docker
- [x] Self Hosted with Kubernetes
- [x] SaaS at flagsmith.com
- [ ] Some other way (add details in description below)

### Describe the bug

Ids in the frontend use number type, which is IEEE 754 floating point precision. This means 64bit int Ids are mangled and the frontend isn't able to lookup resources.

Ids should be typed to BigInt to enable use of 64bit int Ids.

### Steps To Reproduce

Create an object with an Id > [MAX_SAFE_INTEGER](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/MAX_SAFE_INTEGER).

View the object in the UI.

UI will not be able to load the object, as it'll perform the lookup on a number value that doesn't exist.

### Expected behavior

The UI will load and render the object from the API.

### Screenshots

_No response_

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.