Skip to content

Conversation

@talissoncosta
Copy link
Contributor

@talissoncosta talissoncosta commented Nov 7, 2025

  • 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?
  • I have used a Conventional Commit title for this Pull Request

Fixes #6219 When a project has segment change requests enabled and a change request is created for one segment, all segments (including the "New segment" modal) incorrectly show the warning that there are open change requests. The warning should only appear on the segment that actually has an open change request.

Changes

The issue was caused by a query parameter mismatch between the frontend and the backend API:
Frontend was sending: version_of: segmentId
Backend expected: segment_id
In the ExistingProjectChangeRequestAlert component, the API query was using an incorrect parameter name (version_of) that the backend API doesn't recognize. As a result, the filter wasn't being applied, and the API was returning all open change requests for the project instead of just those for the specific segment.

Changes Made

  • ExistingProjectChangeRequestAlert.tsx
    • Changed query parameter from version_of to segment_id
  • requests.ts
    • Updated TypeScript type definition to match the correct API parameter name

How did you test this code?

Manual Testing Steps:

  • Create a segment in a project with workflows enabled
  • Create a change request that modifies that segment
  • Navigate to the segment list or segment details page
  • ✅ Verify the warning only appears on the segment with the open change request
  • ✅ Verify other segments don't show the warning
  • ✅ Verify the "New segment" modal doesn't show the warning

Impact

  • Before: All segments showed change request warnings when any segment had an open change request
  • After: Only the specific segment with an open change request shows the warning

@talissoncosta talissoncosta requested a review from a team as a code owner November 7, 2025 16:42
@talissoncosta talissoncosta requested review from Zaimwa9 and removed request for a team November 7, 2025 16:42
@vercel
Copy link

vercel bot commented Nov 7, 2025

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

Project Deployment Preview Comments Updated (UTC)
flagsmith-frontend-preview Ready Ready Preview Comment Nov 7, 2025 4:42pm
flagsmith-frontend-staging Ready Ready Preview Comment Nov 7, 2025 4:42pm
1 Skipped Deployment
Project Deployment Preview Comments Updated (UTC)
docs Ignored Ignored Nov 7, 2025 4:42pm

@github-actions github-actions bot added front-end Issue related to the React Front End Dashboard fix labels Nov 7, 2025
@github-actions
Copy link
Contributor

github-actions bot commented Nov 7, 2025

Docker builds report

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

Copy link
Contributor

@Zaimwa9 Zaimwa9 left a comment

Choose a reason for hiding this comment

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

Alright, so basically the bug was coming from a wrong query param right? Good catch thanks

@talissoncosta talissoncosta merged commit 560a04d into main Nov 10, 2025
31 checks passed
@talissoncosta talissoncosta deleted the fix/segment-change-request-warning branch November 10, 2025 12:15
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.

All segments show change request warning

3 participants