Skip to content

refactor(cr): replace the Flux change request store with RTK Query - #8923

Draft
talissoncosta wants to merge 4 commits into
mainfrom
feat/change-requests-rtk-8774
Draft

talissoncosta wants to merge 4 commits into
mainfrom
feat/change-requests-rtk-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

Contributes to #8774

The change request page and publishing from the feature modal stop using the Flux change request store, which is removed:

  • New RTK endpoints: getChangeRequest, actionChangeRequest (approve and publish) and updateChangeRequestAssignees. Each mutation refreshes the change request, the sidebar counts and feature states once it succeeds, so a failed follow-up request can no longer leave the page stuck with stale counts.
  • The page reads one hook, useChangeRequestDetail.
  • change-requests-store.js and its four AppActions are deleted.

How did you test this code?

Locally, on a v1 and a v2 (versioned) environment:

  • Approve, publish, delete, and add or remove assignees from the change request page.
  • Edit a change request from the feature modal, and schedule a change from the modal in an environment without approvals.
  • With the change request refetch forced to fail after publishing: the counts still refresh and the API's error shows.

…K Query behind change_requests_rtk

The change request page reads one data hook. With change_requests_rtk on,
it loads the change request and its feature through RTK Query, and approve,
publish, delete and assignee changes are mutations that refresh the counts
on success. With it off, the Flux store path is unchanged.

Contributes to #8774

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@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 8:18pm UTC
flagsmith-frontend-staging Ready Ready Preview Nov 9, 2026 8:18pm UTC
1 Skipped Deployment
Project Deployment Actions Updated
docs Ignored Ignored Preview Nov 9, 2026 8:18pm UTC

Request Review

@coderabbitai

coderabbitai Bot commented Nov 9, 2026

Copy link
Copy Markdown

Important

Draft PR not reviewed

Draft PRs are not automatically reviewed by default.

  • Trigger a manual review

To automatically review draft PRs, update your CodeRabbit configuration:

reviews:
  auto_review:
    drafts: true
  • 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

…fetches on the RTK path

A failed lookup now shows the error instead of "feature since deleted",
which is kept for a 404. The page no longer refetches and fades on window
focus, like the Flux store. Assignee updates take the route id like the
other change request calls.

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

The change request page and publishing from the feature modal now always
use RTK Query, so change-requests-store.js and its actions go.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@talissoncosta talissoncosta changed the title refactor(Change requests): Move the change request page onto RTK Query refactor(Change requests): Replace the Flux change request store with RTK Query Nov 9, 2026
@github-actions github-actions Bot added refactor and removed refactor labels Nov 9, 2026
…ne starts

Each mutation keeps its last error, so a failed approve stayed on screen
after a later successful change. The not-found and error message rules move
to requestError.ts, shared by the hook and the query, with unit tests.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@github-actions github-actions Bot added refactor and removed refactor labels Nov 9, 2026
@talissoncosta talissoncosta changed the title refactor(Change requests): Replace the Flux change request store with RTK Query refactor(cr): replace the Flux change request store with RTK Query Nov 9, 2026

This branch was successfully deployed

2 active deployments
Preview – flagsmith-frontend-staging — afce97f4 Deployed Nov 9, 2026 by vercel[bot]
Preview – flagsmith-frontend-preview — afce97f4 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

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant