PATCH on a multivariate option returns 500 (KeyError: 'feature')
维护者通常 1 天内回复
还没有人认领这个 Issue。
评估
调研方向
报告指出 features/multivariate/serializers.py 第 85 行,其中 validate() 在部分更新期间引发 KeyError: 'feature'。阅读该 serializer 及其附近的测试,然后运行相关的 multivariate option API 测试。当仅包含 string_value 的 PATCH 不再返回 500,或者在不支持 PATCH 时返回明确的 400,即为完成。
由索引模型根据 Issue 内容生成。
描述
Version: self-hosted 2.295.2 (flagsmith/flagsmith:2.295.2, Docker Compose)
What happens
A partial update of a multivariate option returns HTTP 500 unless the body repeats every field:
curl -i -X PATCH -H "Authorization: Api-Key $ORG_API_KEY" -H "Content-Type: application/json" \
"http://localhost:8000/api/v1/projects/<project>/features/<feature>/mv-options/<option>/" \
-d '{"string_value": "green"}'
Server log
File "/app/features/multivariate/serializers.py", line 85, in validate
KeyError: 'feature'
Expected
The option's value is updated (a 400 would also be fine if PATCH isn't supported), not a 500.
Notes
validate() reads attrs["feature"], which a partial update doesn't include; self.instance.feature could be used instead. Found while building FlagLens, whose seed script works around it.
- 主要语言
- Python
- 星标
- 9.9k
- 派生
- 658
- 平均合并
- 1 天 15 小时
- 30 天内合并 PR
- 168
环境准备
- 提供 Dockerfile 或 Docker Compose 文件
- 有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
Flagsmith/flagsmith 的其他 Issue
-
Fix Button Alignment in SDK Installation Section可能已有人在做 @manueldezman 于 3 天前认领。 未关闭bug
难度 2/5 1-3 小时 新手友好度 62/100
Flagsmith/flagsmith#9056 · 2 条评论 ·
维护者通常 1 天内回复
-
Cloud Python warehouse snippet omits the import needed by its short-lived-job guidance可能已有人在做 @jcd1991 于 4 天前认领。 未关闭
难度 1/5 1 小时以内 新手友好度 75/100
Flagsmith/flagsmith#9045 · 1 条评论 ·
维护者通常 1 天内回复
-
Expose whether an organisation is blocked for API usage可能已有人在做 @PiUnknown 于 38 天前认领。 未关闭
难度 2/5 1-3 小时 新手友好度 62/100
Flagsmith/flagsmith#8773 · 1 条评论 ·
维护者通常 1 天内回复
-
influx_query_manager doesn't catch ApiException, so Influx error responses 500可能已有人在做 @SAY-5 于 13 天前认领。 未关闭
难度 2/5 1-3 小时 新手友好度 82/100
Flagsmith/flagsmith#8510 · 1 条评论 ·
维护者通常 1 天内回复
-
TypeError: Cannot read properties of undefined (reading 'enabled') in CompareFeatures renderRow可能已有人在做 @Poison675 于 5 天前认领。 未关闭
难度 2/5 1-3 小时 新手友好度 76/100
Flagsmith/flagsmith#8224 · 2 条评论 ·
维护者通常 1 天内回复
查看 Flagsmith/flagsmith 的全部 Issue
相似的 Issue
-
ui
难度 2/5 1-3 小时 新手友好度 78/100
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 76/100
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 82/100
ARTPARK-SAHAI-ORG/calibrate-frontend#919 ·
维护者通常 1 天内回复
-
CI: MSYS2 jobs fail — mingw python3 package renamed upstream to python可能已有人在做 @ronaldtse 今天认领。 未关闭
难度 1/5 1 小时以内 新手友好度 95/100
-
难度 2/5 1-3 小时 新手友好度 76/100
pydantic/pytest-examples#102 · 1 条评论 ·