[sdk/local-evaluation] Duplicate identity override entries silently drop feature overrides
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 3/5
- Tempo stimato
- 1-2 giorni
- Idoneità per principianti
- 68/100
- Tipo di issue
- Bug
- Chiarezza
- Specificata chiaramente
- Stato di attività
- Tranquilla
- Stack tecnologico
- nodejs, typescript
- Ambito
- backend
Direzione di ricerca
Inizia dal percorso di valutazione locale usato da getIdentityFlags e segui come vengono rappresentate le voci identity_overrides duplicate per un identificatore. Riproduci il payload con voci separate per some_feature e mv_feature, quindi verifica che vengano restituiti entrambi gli override e gli stati abilitati, invece di ricorrere al valore predefinito dell’ambiente.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
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.
- Lingua principale
- TypeScript
- Stelle
- 30
- Fork
- 27
- Merge medio
- 20h 52m
- PR unite (30g)
- 6
Guida per i contributori
Apri la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di Flagsmith/flagsmith-nodejs-client
-
Difficoltà 4/5 3-5 giorni Idoneità per principianti 65/100
-
Difficoltà 4/5 3-5 giorni Idoneità per principianti 48/100
-
Dependency Dashboard Aperta
Difficoltà 4/5 3-5 giorni Idoneità per principianti 25/100
-
Difficoltà 4/5 3-5 giorni Idoneità per principianti 55/100
Flagsmith/flagsmith-nodejs-client#273 · 1 commento ·
-
Difficoltà 3/5 1-2 giorni Idoneità per principianti 45/100
Tutte le issue di Flagsmith/flagsmith-nodejs-client
Issue simili
-
blocklist removal
Difficoltà 2/5 1-3 ore Idoneità per principianti 65/100
MetaMask/eth-phishing-detect#296544 ·
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 70/100
pastelsky/bundlephobia#1122 ·
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 70/100
-
category/development priority/P2 scope/file-operations scope/testing type/enhancement
Difficoltà 2/5 1-3 ore Idoneità per principianti 75/100
-
Enatega Customer and Rider app: Add-ons price is not visible to customer after order is placed. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 75/100