Skip to content

fix: convert feature_state_value after v2 segment save (#6962)#6967

Open
talissoncosta wants to merge 1 commit intomainfrom
fix/v2-segment-save-feature-state-value-6962
Open

fix: convert feature_state_value after v2 segment save (#6962)#6967
talissoncosta wants to merge 1 commit intomainfrom
fix/v2-segment-save-feature-state-value-6962

Conversation

@talissoncosta
Copy link
Contributor

@talissoncosta talissoncosta commented Mar 16, 2026

  • 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 #6962

After saving segment overrides on a v2 versioned environment, the getVersionFeatureState API returns feature_state_value as a FeatureStateValue object (e.g. {type: "unicode", string_value: "hello", ...}). The v2 segment save path in feature-list-store.ts was storing this raw object in the model, causing the UI to render [object Object] instead of the actual value.

The v2 VALUE save path (line 820) already converts correctly using Utils.featureStateToValue() — this PR aligns the SEGMENT path to do the same.

How did you test this code?

  1. Enable v2 feature versioning on an environment
  2. Create a flag with a value
  3. Add a segment override and save
  4. Verify the feature value displays correctly (not [object Object])

…6962)

The v2 segment save path stores the API response's feature_state_value
as a FeatureStateValue object instead of converting it to a primitive,
causing [object Object] to appear in the UI. The VALUE path already
handles this correctly — this aligns the SEGMENT path to do the same.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@vercel
Copy link

vercel bot commented Mar 16, 2026

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

Project Deployment Actions Updated (UTC)
flagsmith-frontend-preview Ready Ready Preview, Comment Mar 16, 2026 8:37pm
flagsmith-frontend-staging Ready Ready Preview, Comment Mar 16, 2026 8:37pm
1 Skipped Deployment
Project Deployment Actions Updated (UTC)
docs Ignored Ignored Mar 16, 2026 8:37pm

Request Review

@github-actions github-actions bot added front-end Issue related to the React Front End Dashboard fix labels Mar 16, 2026
@talissoncosta talissoncosta marked this pull request as ready for review March 16, 2026 20:38
@talissoncosta talissoncosta requested a review from a team as a code owner March 16, 2026 20:38
@talissoncosta talissoncosta requested review from Zaimwa9 and removed request for a team March 16, 2026 20:38
@claude
Copy link

claude bot commented Mar 16, 2026

⚠️ Code review skipped — your organization's overage spend limit has been reached.

Code review is billed via overage credits. To resume reviews, an organization admin can raise the monthly limit in Settings → Usage.

Once credits are available, reopen this pull request to trigger a review.

@github-actions github-actions bot removed the fix label Mar 16, 2026
@github-actions
Copy link
Contributor

github-actions bot commented Mar 16, 2026

Docker builds report

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

@github-actions github-actions bot added the fix label Mar 16, 2026
@github-actions
Copy link
Contributor

github-actions bot commented Mar 16, 2026

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

passed  10 passed

Details

stats  10 tests across 7 suites
duration  49.3 seconds
commit  382c7cc
info  🔄 Run: #15316 (attempt 1)

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

passed  10 passed

Details

stats  10 tests across 7 suites
duration  29.8 seconds
commit  382c7cc
info  🔄 Run: #15316 (attempt 1)

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

passed  16 passed

Details

stats  16 tests across 13 suites
duration  1 minute, 10 seconds
commit  382c7cc
info  🔄 Run: #15316 (attempt 1)

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

passed  2 passed

Details

stats  2 tests across 2 suites
duration  1 minute, 5 seconds
commit  382c7cc
info  🔄 Run: #15316 (attempt 1)

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.

Feature value shows [object Object] after saving segment overrides (v2 versioning)

1 participant