Skip to content

fix(scheduling): Stop counting published change requests in the badge - #8914

Open
talissoncosta wants to merge 5 commits into
mainfrom
fix/scheduling-badge-count-8774
Open

talissoncosta wants to merge 5 commits into
mainfrom
fix/scheduling-badge-count-8774

Conversation

@talissoncosta

@talissoncosta talissoncosta commented Nov 9, 2026 •

Copy link
Copy Markdown
Contributor
  • I have read the Contributing Guide.
  • I have added information to docs/ if required so people know about the feature.
  • I have filled in the "Changes" section below.
  • I have filled in the "How did you test this code" section below.

Changes

Closes #8774

The Scheduling badge counted change requests that were published straight away. The time it filtered on was fixed when the page loaded, so anything committed after that looked scheduled until a refresh.

  • Adds a getScheduledChangeRequests endpoint that always sends committed=true and the current time with each request. The sidebar badge and the Scheduling page both use it. getChangeRequests is unchanged.
  • The Scheduling page refetches each time it opens, since its arguments no longer change between visits.
  • The change request E2E test now checks the Scheduling badge stays empty after publishing, before the page reloads.

How did you test this code?

  • E2E: the new check fails on main (Scheduling1) and passes on this branch.
  • Manually, locally and on staging:
    1. Open an environment with change requests turned on and keep the tab open.
    2. Create a change request in that tab, approve it with another user, then publish it straight away without reloading.
    3. main shows a Scheduling badge of 1; this branch shows none.

The Scheduling badge and page pinned live_from_after to mount time, so
change requests published immediately after mount counted as scheduled.
A dedicated getScheduledChangeRequests endpoint reads the time on every
request, so the refetch after a commit uses the current time.

Closes #8774

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@coderabbitai

coderabbitai Bot commented Nov 9, 2026 •

Copy link
Copy Markdown

Explain Change →

No actionable comments were generated in the recent review.

Walkthrough

The frontend adds a paged query for scheduled change requests. The query requires an environment ID and sets committed: true and live_from_after when the query runs. The environment navbar and Scheduling page use the new query hook. An end-to-end test checks that the Scheduling link text is exactly “Scheduling” after publishing.

Estimated code review effort: 2 (Simple) | ~10 minutes

Severity of issue fixed: Low

Merge Risk: Low · up to 6f820

The scheduled-query change is mergeable with bounded test-coverage limitations: the badge check can pass before a delayed or failed refresh is detected. No concrete production regression was established.

- [ ] Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

Recent review info

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Organization UI
  • Review profile: ASSERTIVE
  • Plan: Advanced
  • Run ID: 165aae2b-6d14-4ced-9dfb-7f4654c4be80
Commits

Reviewing files that changed from the base of the PR and between 11a3cfe and 6f8200a.

Files selected for processing: 1

  • frontend/e2e/tests/change-request-test.pw.ts

Included review availability: This review used your included allowance. Your plan provides up to 8 included reviews per hour; 6 remain after this review.

@vercel

vercel Bot commented Nov 9, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
flagsmith-frontend-preview Ready Ready Preview Nov 9, 2026 7:13pm UTC
flagsmith-frontend-staging Ready Ready Preview Nov 9, 2026 7:13pm UTC
1 Skipped Deployment
Project Deployment Actions Updated
docs Ignored Ignored Preview Nov 9, 2026 7:13pm UTC

Request Review

…ediate publish

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@github-actions

github-actions Bot commented Nov 9, 2026 •

Copy link
Copy Markdown
Contributor

Docker builds report

Image Build Status Security report
ghcr.io/flagsmith/flagsmith-api-test:pr-8914 Finished ✅ Skipped
ghcr.io/flagsmith/flagsmith-e2e:pr-8914 Finished ✅ Skipped
ghcr.io/flagsmith/flagsmith-api:pr-8914 Finished ✅ Results ✅
ghcr.io/flagsmith/flagsmith:pr-8914 Finished ✅ Results ✅
ghcr.io/flagsmith/flagsmith-private-cloud:pr-8914 Finished ✅ Results ✅
ghcr.io/flagsmith/flagsmith-frontend:pr-8914 Finished ✅ Results ✅

@github-actions github-actions Bot added the fix label Nov 9, 2026
@github-actions

github-actions Bot commented Nov 9, 2026 •

Copy link
Copy Markdown
Contributor
✅ private-cloud · depot-ubuntu-latest-arm-16 — run #22990 (attempt 1)

Playwright Test Results (private-cloud - depot-ubuntu-latest-arm-16)

passed  2 passed

Details

stats  2 tests across 2 suites
duration  59.9 seconds
commit  6f8200a
info  🔄 Run: #22990 (attempt 1)

🗂️ Previous results
✅ private-cloud · depot-ubuntu-latest-16 — run #22990 (attempt 1)

Playwright Test Results (private-cloud - depot-ubuntu-latest-16)

passed  2 passed

Details

stats  2 tests across 2 suites
duration  55.6 seconds
commit  6f8200a
info  🔄 Run: #22990 (attempt 1)

✅ oss · depot-ubuntu-latest-arm-16 — run #22990 (attempt 1)

Playwright Test Results (oss - depot-ubuntu-latest-arm-16)

passed  1 passed

Details

stats  1 test across 1 suite
duration  34.3 seconds
commit  6f8200a
info  🔄 Run: #22990 (attempt 1)

✅ oss · depot-ubuntu-latest-16 — run #22990 (attempt 1)

Playwright Test Results (oss - depot-ubuntu-latest-16)

passed  1 passed

Details

stats  1 test across 1 suite
duration  32.8 seconds
commit  6f8200a
info  🔄 Run: #22990 (attempt 1)

❌ private-cloud · depot-ubuntu-latest-arm-16 — run #22987 (attempt 1)

Playwright Test Results (private-cloud - depot-ubuntu-latest-arm-16)

failed  1 failed
passed  1 passed

Details

stats  2 tests across 2 suites
duration  1 minute, 1 second
commit  11a3cfe
info  📦 Artifacts: View test results and HTML report
🔄 Run: #22987 (attempt 1)

Failed tests

firefox › tests/environment-permission-test.pw.ts › Environment Permission Tests › Environment-level permissions control access to features, identities, and segments @enterprise

✅ private-cloud · depot-ubuntu-latest-16 — run #22987 (attempt 1)

Playwright Test Results (private-cloud - depot-ubuntu-latest-16)

passed  3 passed

Details

stats  3 tests across 3 suites
duration  33 seconds
commit  11a3cfe
info  🔄 Run: #22987 (attempt 1)

✅ oss · depot-ubuntu-latest-arm-16 — run #22987 (attempt 1)

Playwright Test Results (oss - depot-ubuntu-latest-arm-16)

passed  1 passed

Details

stats  1 test across 1 suite
duration  34.8 seconds
commit  11a3cfe
info  🔄 Run: #22987 (attempt 1)

✅ oss · depot-ubuntu-latest-16 — run #22987 (attempt 1)

Playwright Test Results (oss - depot-ubuntu-latest-16)

passed  1 passed

Details

stats  1 test across 1 suite
duration  31.7 seconds
commit  11a3cfe
info  🔄 Run: #22987 (attempt 1)

✅ private-cloud · depot-ubuntu-latest-16 — run #22983 (attempt 1)

Playwright Test Results (private-cloud - depot-ubuntu-latest-16)

passed  2 passed

Details

stats  2 tests across 2 suites
duration  34.8 seconds
commit  3278a21
info  🔄 Run: #22983 (attempt 1)

✅ private-cloud · depot-ubuntu-latest-arm-16 — run #22983 (attempt 1)

Playwright Test Results (private-cloud - depot-ubuntu-latest-arm-16)

passed  3 passed

Details

stats  3 tests across 3 suites
duration  37.8 seconds
commit  3278a21
info  🔄 Run: #22983 (attempt 1)

✅ oss · depot-ubuntu-latest-16 — run #22983 (attempt 1)

Playwright Test Results (oss - depot-ubuntu-latest-16)

passed  1 passed

Details

stats  1 test across 1 suite
duration  32.7 seconds
commit  3278a21
info  🔄 Run: #22983 (attempt 1)

✅ oss · depot-ubuntu-latest-arm-16 — run #22983 (attempt 1)

Playwright Test Results (oss - depot-ubuntu-latest-arm-16)

passed  1 passed

Details

stats  1 test across 1 suite
duration  36.1 seconds
commit  3278a21
info  🔄 Run: #22983 (attempt 1)

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 2

Additional comments: 1

frontend/common/services/useChangeRequest.ts: 1

83-83: Minor · Potential issue · Poor tradeoff

Unverified finding
We couldn't verify this from the code. It is shown for review, not as a verified issue.

The endpoint generates a new cutoff for each paged request. If the server uses offset pagination, entries becoming due between page requests can shift the result set, so page 2 need not continue where page 1 ended.

A still-scheduled change can be skipped from the paginated list.

This can occur when: A user loads page 1 of 50 scheduled changes; one of those changes becomes due before they request page 2.

Review info

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Organization UI
  • Review profile: ASSERTIVE
  • Plan: Advanced
  • Run ID: 7129dd3c-9331-4825-a8ff-415207559f9e
Commits

Reviewing files that changed from the base of the PR and between 13539af and 1c9bfca.

Files selected for processing: 5

  • frontend/common/services/useChangeRequest.ts
  • frontend/common/types/requests.ts
  • frontend/e2e/tests/change-request-test.pw.ts
  • frontend/web/components/navigation/navbars/EnvironmentNavbar.tsx
  • frontend/web/components/pages/ScheduledChangesPage.tsx

Included review availability: This review used your included allowance. Your plan provides up to 8 included reviews per hour; 7 remain after this review.

@github-actions

github-actions Bot commented Nov 9, 2026 •

Copy link
Copy Markdown
Contributor

Visual Regression

24 screenshots compared. See report for details.
View full report

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 4

Additional comments: 1

frontend/web/components/pages/ScheduledChangesPage.tsx: 1

47-47: Minor · Potential issue · Poor tradeoff

Unverified finding
We couldn't verify this from the code. It is shown for review, not as a verified issue.

The new query obtains the time filter at each request, so offset-based pages can use different eligible sets. A change expiring from an earlier page between requests can shift a still-scheduled record across the page boundary.

The remaining scheduled change that shifted onto page one may be omitted from the pages the user viewed, or the second-page request may fail if the server rejects an out-of-range page.

This can occur when: There are 51 scheduled changes, one on the first page goes live after that page is loaded, and the user requests page two.

Review info

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Organization UI
  • Review profile: ASSERTIVE
  • Plan: Advanced
  • Run ID: 31e69a58-5fe9-4456-bf59-360f149e3533
Commits

Reviewing files that changed from the base of the PR and between 1c9bfca and 3278a21.

Files selected for processing: 1

  • frontend/web/components/pages/ScheduledChangesPage.tsx

Included review availability: This review used your included allowance. Your plan provides up to 8 included reviews per hour; 6 remain after this review.

@talissoncosta talissoncosta changed the title fix(Scheduling): Only count change requests that are still scheduled fix(scheduling): Only count change requests that are still scheduled Nov 9, 2026
…ng the badge

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 5

Review info

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Organization UI
  • Review profile: ASSERTIVE
  • Plan: Advanced
  • Run ID: c22e4105-5e78-4e4d-a4b0-3fdc1dbc43ab
Commits

Reviewing files that changed from the base of the PR and between 3278a21 and 11a3cfe.

Files selected for processing: 1

  • frontend/e2e/tests/change-request-test.pw.ts

Included review availability: This review used your included allowance. Your plan provides up to 8 included reviews per hour; 6 remain after this review.

…e checking the badge"

This reverts commit 11a3cfe. The timing code made a one-line regression
check hard to read. The plain check already fails on main and passes with
the fix.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@github-actions github-actions Bot added fix and removed fix labels Nov 9, 2026
@talissoncosta talissoncosta changed the title fix(scheduling): Only count change requests that are still scheduled fix(Scheduling): Stop counting published change requests in the badge Nov 9, 2026
@talissoncosta talissoncosta changed the title fix(Scheduling): Stop counting published change requests in the badge fix(scheduling): Stop counting published change requests in the badge Nov 9, 2026

This branch was successfully deployed

2 active deployments
Preview – flagsmith-frontend-preview — 6f8200ad Deployed Nov 9, 2026 by vercel[bot]
Preview – flagsmith-frontend-staging — 6f8200ad Deployed Nov 9, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

fix front-end Issue related to the React Front End Dashboard

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Scheduling badge counts change requests that aren't scheduled

2 participants