Feature values always have type string when using local evaluation mode
还没有人认领这个 Issue。
评估
- 难度
- 3/5
- 预计耗时
- 1-2 天
- 新手友好度
- 42/100
- Issue 类型
- 缺陷
- 描述清晰度
- 基本清楚
- 活跃度
- 停滞
- 技术栈
- nodejs, typescript
- 领域
- backend
调研方向
从 enableLocalEvaluation 为 true 时由 getEnvironmentFlags() 和 getFlag() 执行的 Flagsmith 客户端路径开始,使用提供的 TypeScript 脚本复现不同的值类型。将本地评估结果与 API 结果进行比较,并验证数值型 feature 值在两种模式下都保留其数字类型。
由索引模型根据 Issue 内容生成。
描述
We've started seeing an issue where number values like this one are being returned as type string when enableLocalEvaluation is set to true.
Using this test script I've validated that the local evaluation causes the change in behaviour (thanks Matt for the help 🙌 )
This has been tested on flagsmith-nodejs versions 2.5.1 and 3.2.0
import Flagsmith from 'flagsmith-nodejs';
async function main(): Promise<void> {
const flagClient = new Flagsmith({
environmentKey: 'ser.key',
enableLocalEvaluation: true,
enableAnalytics: false,
});
const environmentFlags = await flagClient.getEnvironmentFlags();
const flag = environmentFlags.getFlag('daisy.settlements.timeout');
console.log(`flagClient.apiUrl=${flagClient.apiUrl}`);
console.log(`flagClient.enableLocalEvaluation=${flagClient.enableLocalEvaluation}`);
console.log(JSON.stringify(flag));
console.log(`typeof flag.value=${typeof flag.value}`);
await flagClient.close();
}
void main();
enableLocalEvaluation=true
flagClient.apiUrl=https://edge.api.flagsmith.com/api/v1/
flagClient.enableLocalEvaluation=true
{"value":"60000","enabled":true,"isDefault":false,"featureId":62178,"featureName":"daisy.settlements.timeout"}
typeof flag.value=string
enableLocalEvaluation=false
flagClient.apiUrl=https://edge.api.flagsmith.com/api/v1/
flagClient.enableLocalEvaluation=false
{"value":60000,"enabled":true,"isDefault":false,"featureId":62178,"featureName":"daisy.settlements.timeout"}
typeof flag.value=number
- 主要语言
- 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
-
难度 2/5 1-3 小时 新手友好度 78/100
维护者通常 1 天内回复
-
难度 1/5 1 小时以内 新手友好度 82/100
homarr-labs/dashboard-icons#2939 ·
维护者通常 1 天内回复
-
Agent/category reasoning variants are still checked against the stale model cache in chat.params未关闭opencode
难度 2/5 1-3 小时 新手友好度 75/100
code-yeongyu/oh-my-openagent#10003 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 77/100
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 65/100
nextcloud-libraries/nextcloud-dialogs#2669 ·
维护者通常 1 天内回复