Scheduling badge counts change requests that aren't scheduled
维护者通常 1 天内回复
评估
- 难度
- 2/5
- 预计耗时
- 1-3 小时
- 新手友好度
- 68/100
- Issue 类型
- 缺陷
- 描述清晰度
- 描述清楚
- 活跃度
- 活跃
- 技术栈
- react, typescript
- 领域
- frontend
调研方向
过期时间戳来自 frontend/web/components/navigation/navbars/EnvironmentNavbar.tsx:24 中的 useRef(moment().toISOString()),同样的模式也出现在 frontend/web/components/pages/ScheduledChangesPage.tsx:40 中的 useMemo(..., [])。请先复现徽章问题:立即提交两个 change request,然后在发起请求时计算 live_from_after。完成标准是:提交后无需刷新,徽章保持为空;Scheduling 页面仍然只列出未来日期的变更。
由索引模型根据 Issue 内容生成。
描述
How are you running Flagsmith
- SaaS at flagsmith.com
Describe the bug
The Scheduling item in the environment sidebar shows a count badge for change requests that were committed for immediate publish, not scheduled. The Scheduling page itself correctly shows no scheduled changes, and the badge clears on a page refresh.
Steps To Reproduce
- Enable change requests on an environment.
- Load the dashboard and leave the tab open.
- Create two change requests, approve and commit them, publishing immediately (no schedule).
- Look at Scheduling in the environment sidebar — it shows a
2badge. - Refresh the page — the badge disappears.
Expected behavior
No badge, as there are no scheduled changes.
Likely cause
frontend/web/components/navigation/navbars/EnvironmentNavbar.tsx:24 pins live_from_after to the time the navbar mounted:
const date = useRef(moment().toISOString())
const { data: scheduledData } = useGetChangeRequestsQuery({
committed: true, environmentId, live_from_after: date.current, page_size: 1,
})
A change request published immediately gets a live_from of its commit time, which is after that pinned timestamp, so the list endpoint returns it and the badge counts it as scheduled. Committing invalidates the ChangeRequest LIST tag, so the query refetches — but with the same stale timestamp. A refresh re-mounts the navbar with a current timestamp, so the change request drops out.
frontend/web/components/pages/ScheduledChangesPage.tsx:40 pins the same value with useMemo(..., []), so a long-lived session on that page will drift the same way.
Computing live_from_after at request time rather than at mount, or filtering server-side on "live in the future", would both fix it.
- 主要语言
- Python
- 星标
- 6.6k
- 派生
- 584
- 平均合并
- 2 天 13 小时
- 30 天内合并 PR
- 131
环境准备
- 提供 Dockerfile 或 Docker Compose 文件
- 有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
Flagsmith/flagsmith 的其他 Issue
-
Expose whether an organisation is blocked for API usage可能已有人在做 @PiUnknown 今天认领。 未关闭
难度 2/5 1-3 小时 新手友好度 62/100
Flagsmith/flagsmith#8773 · 1 条评论 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 75/100
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 85/100
Flagsmith/flagsmith#8681 · 1 条评论 ·
维护者通常 1 天内回复
-
Flag dependency needs user documentation可能已有人在做 @emyller 于 12 天前认领。 未关闭
难度 2/5 1-3 小时 新手友好度 72/100
Flagsmith/flagsmith#8524 · 1 条评论 · 已指派 1 人 ·
维护者通常 1 天内回复
-
influx_query_manager doesn't catch ApiException, so Influx error responses 500可能已有人在做 @siddiqueirshad 于 26 天前认领。 未关闭
难度 2/5 1-3 小时 新手友好度 82/100
Flagsmith/flagsmith#8510 · 1 条评论 ·
维护者通常 1 天内回复
查看 Flagsmith/flagsmith 的全部 Issue
相似的 Issue
-
难度 2/5 1-3 小时 新手友好度 68/100
docling-project/docling-mcp#147 ·
-
难度 2/5 1-3 小时 新手友好度 80/100
维护者通常 1 天内回复
-
enhancement
难度 2/5 1-3 小时 新手友好度 76/100
autowarefoundation/autoware_carla_scenario#405 ·
维护者通常 1 天内回复
-
bug
难度 2/5 1-3 小时 新手友好度 79/100
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 78/100
mohitmishra786/readprism#322 ·
维护者通常 1 天内回复