[sdk/local-evaluation] Duplicate identity override entries silently drop feature overrides
评估
- 难度
- 3/5
- 预计耗时
- 1-2 天
- 新手友好度
- 68/100
- Issue 类型
- 缺陷
- 描述清晰度
- 描述清楚
- 活跃度
- 冷清
- 技术栈
- nodejs, typescript
- 领域
- backend
调研方向
从 getIdentityFlags 使用的本地评估路径开始,跟踪针对一个标识符的重复 identity_overrides 条目是如何表示的。使用分开的 some_feature 和 mv_feature 条目复现 payload,然后验证返回的是两个 override 及其启用状态,而不是回退到环境默认值。
由索引模型根据 Issue 内容生成。
描述
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.
- 主要语言
- TypeScript
- 星标
- 30
- 派生
- 28
- 平均合并
- 7 天 23 小时
- 30 天内合并 PR
- 3
环境准备
- 没有 Dockerfile 或 Docker Compose 文件
- 有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
Flagsmith/flagsmith-nodejs-client 的其他 Issue
-
难度 2/5 1 小时以内 新手友好度 85/100
-
难度 4/5 3-5 天 新手友好度 65/100
-
难度 4/5 3-5 天 新手友好度 48/100
-
难度 4/5 3-5 天 新手友好度 25/100
-
难度 4/5 3-5 天 新手友好度 55/100
Flagsmith/flagsmith-nodejs-client#273 · 1 条评论 ·
查看 Flagsmith/flagsmith-nodejs-client 的全部 Issue
相似的 Issue
-
Dependencies view: `getParent` loops forever on untitled documents, extension host runs out of memory可能已有人在做 关联的 PR 仍在进行中或已合并。 未关闭bug
难度 2/5 1-3 小时 新手友好度 70/100
维护者通常 1 天内回复
-
bug
难度 2/5 1 小时以内 新手友好度 82/100
awslabs/visual-asset-management-system#413 ·
维护者通常 1 天内回复
-
bug confirmed perf
难度 2/5 1-3 小时 新手友好度 72/100
videojs/video.js#9400 · 1 条评论 ·
维护者通常 1 天内回复
-
bug pending triage scope/agent
难度 1/5 1 小时以内 新手友好度 82/100
维护者通常 1 天内回复
-
good first issue hacktoberfest
难度 2/5 半天 新手友好度 70/100
HelpCode-ai/anythingmcp#996 ·
维护者通常 1 天内回复