[sdk/local-evaluation] Duplicate identity override entries silently drop feature overrides
Maintainers usually reply within 2 days
Assessment
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Newbie friendliness
- 68/100
- Issue type
- Bug
- Clarity
- Clearly specified
- Activity status
- Quiet
- Tech stack
- nodejs, typescript
- Domain
- backend
Research direction
Start at the local-evaluation path used by getIdentityFlags and trace how duplicate identity_overrides entries are represented for one identifier. Reproduce the payload with separate some_feature and mv_feature entries, then verify both overrides and enabled states are returned instead of falling back to the environment default.
Written by the indexing model from the issue text.
Description
Problem
When an environment document returned by the Flagsmith API contains more than one entry in identity_overrides sharing the same identifier, the SDK keeps only the last entry for that identifier during local evaluation. Any identity_features defined on the earlier entries are discarded, so the corresponding flags fall back to the environment default instead of the configured override.
For example, given an environment payload like:
{
"identity_overrides": [
{
"identifier": "multi-override-id",
"identity_features": [
{
"feature": { "name": "some_feature" },
"feature_state_value": "override-from-first-entry",
"enabled": false
}
]
},
{
"identifier": "multi-override-id",
"identity_features": [
{
"feature": { "name": "mv_feature" },
"feature_state_value": "override-from-second-entry",
"enabled": true
}
]
}
]
}
Calling getIdentityFlags('multi-override-id') with local evaluation enabled returns the override for mv_feature only. some_feature resolves to its environment default, as if the first entry never existed.
Impact
Any identifier whose overrides arrive split across multiple identity_overrides entries gets the wrong flag values during server-side local evaluation. The breakage is silent (no warning, no error) and deterministic for a given payload, so affected identifiers stay broken on every request until the environment payload changes shape.
Reproduction
- Use an environment whose
identity_overridesarray contains two entries with the sameidentifier, each carrying a different feature inidentity_features(e.g. entry A overridessome_feature, entry B overridesmv_feature). - Initialise the SDK with
enableLocalEvaluation: trueand callgetIdentityFlags('<that-identifier>'). - Observed: only the features from the last entry are applied.
some_featureresolves to its environment default instead of"override-from-first-entry". - Expected: both
some_featureandmv_featureresolve to their respective override values and enabled states.
- Dominant language
- TypeScript
- Stars
- 30
- Forks
- 30
- Avg merge
- 1d 16h
- Merged PRs (30d)
- 11
Getting set up
- No Dockerfile or Docker Compose file
- Has a pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from Flagsmith/flagsmith-nodejs-client
-
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
Flagsmith/flagsmith-nodejs-client#332 ·
Maintainers usually reply within 2 days
-
Difficulty 2/5 Under an hour Newbie friendliness 85/100
Flagsmith/flagsmith-nodejs-client#304 ·
Maintainers usually reply within 2 days
-
Experimentation events are dropped when they're tracked faster than one batch round-trip, and the buffer can't be raised past Flagsmith's 2 MiB batch limitPossibly taken A pull request linked to this issue is open or already merged. Open
Difficulty 4/5 3-5 days Newbie friendliness 42/100
Flagsmith/flagsmith-nodejs-client#330 ·
Maintainers usually reply within 2 days
-
Dependency DashboardOpen
Difficulty 4/5 3-5 days Newbie friendliness 25/100
Flagsmith/flagsmith-nodejs-client#286 ·
Maintainers usually reply within 2 days
-
Difficulty 4/5 3-5 days Newbie friendliness 55/100
Flagsmith/flagsmith-nodejs-client#273 · 1 comment ·
Maintainers usually reply within 2 days
All issues in Flagsmith/flagsmith-nodejs-client
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
earendil-works/pi#12615 ·
Maintainers usually reply within 1 day
-
My Caps shows "Shared" on private Caps that were never sharedPossibly taken @AksharP5 claimed this today. Open
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
CapSoftware/Cap#4569 · 1 comment ·
Maintainers usually reply within 1 day
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 65/100
OHDSI/Data2Evidence#3749 ·
Maintainers usually reply within 4 days
-
Difficulty 2/5 1-3 hours Newbie friendliness 63/100
Maintainers usually reply within 1 day
-
bug from-app needs-triage
Difficulty 2/5 1-3 hours Newbie friendliness 65/100
nightly-labs/openbot#17688 ·
Maintainers usually reply within 1 day