Hacktoberfest 2026:维护者为十月标记出来的 issue,仍然开放、适合新手。 浏览 Hacktoberfest issue

[sdk/local-evaluation] Duplicate identity override entries silently drop feature overrides

未关闭
#267 5 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

@xolott-ark 已经在做这个了。

开始于 2026年5月8日。

  • #268 来自 @xolott-ark —— 未关闭

评估

难度
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

  1. Use an environment whose identity_overrides array contains two entries with the same identifier, each carrying a different feature in identity_features (e.g. entry A overrides some_feature, entry B overrides mv_feature).
  2. Initialise the SDK with enableLocalEvaluation: true and call getIdentityFlags('<that-identifier>').
  3. Observed: only the features from the last entry are applied. some_feature resolves to its environment default instead of "override-from-first-entry".
  4. Expected: both some_feature and mv_feature resolve to their respective override values and enabled states.
主要语言
TypeScript
星标
30
派生
28
平均合并
7 天 23 小时
30 天内合并 PR
3

环境准备

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

Flagsmith/flagsmith-nodejs-client 的其他 Issue

查看 Flagsmith/flagsmith-nodejs-client 的全部 Issue

相似的 Issue

更多 TypeScript Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。