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

Scheduling badge counts change requests that aren't scheduled

未关闭 适合新手
#8,774 0 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

维护者通常 1 天内回复

@Abhipsita-coder 已经在做这个了。

开始于 2026年10月19日。

  • #8806 来自 @Abhipsita-coder —— 未关闭

评估

难度
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 内容生成。

描述

bug front-end priority-customer
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
  1. Enable change requests on an environment.
  2. Load the dashboard and leave the tab open.
  3. Create two change requests, approve and commit them, publishing immediately (no schedule).
  4. Look at Scheduling in the environment sidebar — it shows a 2 badge.
  5. 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

环境准备

从这里开始

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

Flagsmith/flagsmith 的其他 Issue

查看 Flagsmith/flagsmith 的全部 Issue

相似的 Issue

更多 Python Issue

把新 issue 发到你的邮箱

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