Hacktoberfest 2026:メンテナが10月に向けて印を付けた、オープンで初心者向けの issue。 Hacktoberfest の issue を見る

Scheduling badge counts change requests that aren't scheduled

オープン 初心者向け
#8,774 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

メンテナーはふだん 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 を 2 件作成してバッジを再現してください。そのうえで、リクエストを行う時点で 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時間
マージ済み PR(30日)
131

環境構築

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

Flagsmith/flagsmith のほかの issue

Flagsmith/flagsmith の issue をすべて見る

似ている issue

Python の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。