Skip to content

fix(deep-link): feature value renders as [object Object] - #8341

Merged
talissoncosta merged 1 commit into
mainfrom
fix/deeplink-feature-value-8337
Aug 24, 2026
Merged

fix(deep-link): feature value renders as [object Object]#8341
talissoncosta merged 1 commit into
mainfrom
fix/deeplink-feature-value-8337

Conversation

@talissoncosta

Copy link
Copy Markdown
Contributor

Changes

Closes #8337

Opening a flag through the ?feature=<id> deep link, when that flag is beyond the loaded page, fetches it via features/featurestates/. That endpoint returns feature_state_value as a nested { type, string_value, integer_value, boolean_value, float_value } object, whereas the feature-list path supplies a flat value. The value editor stringified the nested object to [object Object], and a save (even with no edits) would have persisted that over the real value.

pickEnvironmentFlag now flattens the nested value, mirroring Utils.featureStateToValue. The logic is inlined rather than imported so this hook doesn't pull the Flux stores in through common/utils.

How did you test this code?

  • Unit tests in deepLinkedFeature.test.ts cover the flatten path (nested value in → typed value out) plus the existing match/fallback cases.
  • Manually: on a project with a JSON-valued flag beyond the first page, deep-linked to it via ?feature=<id>&tab=value. On main the editor shows [object Object]; on this branch it renders the real JSON. Confirmed the features/featurestates/ request fires (the deep-fetch path) in both cases.

@vercel

vercel Bot commented Aug 21, 2026

Copy link
Copy Markdown

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

Project Deployment Actions Updated (UTC)
flagsmith-frontend-preview Ready Ready Preview Aug 24, 2026 4:21pm
flagsmith-frontend-staging Ready Ready Preview Aug 24, 2026 4:21pm
1 Skipped Deployment
Project Deployment Actions Updated (UTC)
docs Ignored Ignored Preview Aug 24, 2026 4:21pm

Request Review

@coderabbitai

coderabbitai Bot commented Aug 21, 2026

Copy link
Copy Markdown

Review Change Stack

Note

Reviews paused

It looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • ▶️ Resume reviews
  • 🔍 Trigger review
📝 Walkthrough

Walkthrough

pickEnvironmentFlag now flattens nested feature-state values for boolean, float, integer, and string types. It returns undefined when no feature state matches. Tests cover optional nested values, selected fields, and value flattening.

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

Merge Risk: ⚪ Minimal · up to 7f966

The PR fixes incorrect rendering and accidental persistence of deep-linked feature values. No actionable merge-blocking risk remains; the remaining concern is limited to a non-functional TypeScript style cleanup.


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

Comment @coderabbitai help to get the list of available commands.

@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: 3


ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: 0244aba0-928b-46a8-bef9-bd98f1a7d39c

📥 Commits

Reviewing files that changed from the base of the PR and between 227fce1 and 2536152.

📒 Files selected for processing (2)
  • frontend/web/components/pages/features/hooks/__tests__/deepLinkedFeature.test.ts
  • frontend/web/components/pages/features/hooks/deepLinkedFeature.ts

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

Comment thread frontend/web/components/pages/features/hooks/__tests__/deepLinkedFeature.test.ts Outdated
Comment thread frontend/web/components/pages/features/hooks/deepLinkedFeature.ts Outdated
Comment thread frontend/web/components/pages/features/hooks/deepLinkedFeature.ts Outdated
@talissoncosta
talissoncosta force-pushed the fix/deeplink-feature-value-8337 branch from 2536152 to e1ea3de Compare August 21, 2026 14:20
@talissoncosta
talissoncosta marked this pull request as ready for review August 21, 2026 14:22
@talissoncosta
talissoncosta requested a review from a team as a code owner August 21, 2026 14:22
@talissoncosta
talissoncosta requested review from kyle-ssg and removed request for a team August 21, 2026 14:22
@talissoncosta talissoncosta changed the title Deep-linked feature value renders as [object Object] fix(deep-link): feature value renders as [object Object] Aug 21, 2026
@github-actions

github-actions Bot commented Aug 21, 2026

Copy link
Copy Markdown
Contributor

Docker builds report

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

@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: 1


ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: b7142393-f674-4da9-b9d2-d1ff2304132c

📥 Commits

Reviewing files that changed from the base of the PR and between 2536152 and e1ea3de.

📒 Files selected for processing (1)
  • frontend/web/components/pages/features/hooks/deepLinkedFeature.ts

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

@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: 1


ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: 35a7874b-8429-401c-94a7-6947d80ac060

📥 Commits

Reviewing files that changed from the base of the PR and between e1ea3de and e5c6d2a.

📒 Files selected for processing (3)
  • frontend/common/types/responses.ts
  • frontend/web/components/pages/features/hooks/__tests__/deepLinkedFeature.test.ts
  • frontend/web/components/pages/features/hooks/deepLinkedFeature.ts

Included review availability: Your plan provides up to 8 included reviews per hour; 5 remain after this review.

Comment thread frontend/web/components/pages/features/hooks/deepLinkedFeature.ts Outdated
@github-actions

github-actions Bot commented Aug 21, 2026

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

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

passed  1 passed

Details

stats  1 test across 1 suite
duration  35.1 seconds
commit  c1b2a84
info  🔄 Run: #19688 (attempt 1)

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

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

passed  1 passed

Details

stats  1 test across 1 suite
duration  37 seconds
commit  c1b2a84
info  🔄 Run: #19688 (attempt 1)

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

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

passed  1 passed

Details

stats  1 test across 1 suite
duration  44 seconds
commit  c1b2a84
info  🔄 Run: #19688 (attempt 1)

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

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

passed  1 passed

Details

stats  1 test across 1 suite
duration  41.5 seconds
commit  c1b2a84
info  🔄 Run: #19688 (attempt 1)

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

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

passed  2 passed

Details

stats  2 tests across 2 suites
duration  36 seconds
commit  1502cdc
info  🔄 Run: #19662 (attempt 1)

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

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

passed  3 passed

Details

stats  3 tests across 3 suites
duration  59.5 seconds
commit  1502cdc
info  🔄 Run: #19665 (attempt 1)

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

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

passed  23 passed
skipped  1 skipped

Details

stats  24 tests across 18 suites
duration  1 minute, 30 seconds
commit  1502cdc
info  🔄 Run: #19665 (attempt 1)

Skipped tests

firefox › tests/onboarding-tests.pw.ts › Onboarding › New user connects via the single-page onboarding flow @oss

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

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

passed  2 passed

Details

stats  2 tests across 2 suites
duration  42.1 seconds
commit  1502cdc
info  🔄 Run: #19665 (attempt 1)

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

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

passed  1 passed

Details

stats  1 test across 1 suite
duration  46.1 seconds
commit  1502cdc
info  🔄 Run: #19662 (attempt 1)

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

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

passed  23 passed
skipped  1 skipped

Details

stats  24 tests across 18 suites
duration  1 minute, 22 seconds
commit  1502cdc
info  🔄 Run: #19662 (attempt 1)

Skipped tests

firefox › tests/onboarding-tests.pw.ts › Onboarding › New user connects via the single-page onboarding flow @oss

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

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

passed  1 passed

Details

stats  1 test across 1 suite
duration  37.4 seconds
commit  1502cdc
info  🔄 Run: #19662 (attempt 1)

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

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

passed  1 passed

Details

stats  1 test across 1 suite
duration  46 seconds
commit  1502cdc
info  🔄 Run: #19665 (attempt 1)

@github-actions

github-actions Bot commented Aug 21, 2026

Copy link
Copy Markdown
Contributor

Visual Regression

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

@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: 1


ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: 3fc230f5-d7af-4283-8b5e-676735ba2996

📥 Commits

Reviewing files that changed from the base of the PR and between 319af30 and 7f96601.

📒 Files selected for processing (1)
  • frontend/web/components/pages/features/hooks/deepLinkedFeature.ts

Included review availability: Your plan provides up to 8 included reviews per hour; 3 remain after this review.

Comment thread frontend/web/components/pages/features/hooks/deepLinkedFeature.ts

@khvn26 khvn26 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Approved with a question.

Comment thread frontend/web/components/pages/features/hooks/deepLinkedFeature.ts
@codecov

codecov Bot commented Aug 24, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 98.78%. Comparing base (1ad8487) to head (1502cdc).
⚠️ Report is 1 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #8341   +/-   ##
=======================================
  Coverage   98.78%   98.78%           
=======================================
  Files        1609     1609           
  Lines       64578    64578           
=======================================
  Hits        63794    63794           
  Misses        784      784           

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@Zaimwa9 Zaimwa9 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

LGTM

…s it

Opening a flag via the ?feature= deep link when it is beyond the loaded
page fetches it through features/featurestates/, which returns
feature_state_value as a nested {type, string_value, ...} object rather
than the flat value the feature-list path supplies. The value editor
stringified that object to "[object Object]", and a save would have
persisted it over the real value.

Flatten the nested value in pickEnvironmentFlag, mirroring
Utils.featureStateToValue (inlined to keep the Flux stores out of this
hook).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@talissoncosta
talissoncosta force-pushed the fix/deeplink-feature-value-8337 branch from 1502cdc to c1b2a84 Compare August 24, 2026 16:20
@github-actions github-actions Bot added fix and removed fix labels Aug 24, 2026
@talissoncosta
talissoncosta merged commit ac56c47 into main Aug 24, 2026
31 checks passed
@talissoncosta
talissoncosta deleted the fix/deeplink-feature-value-8337 branch August 24, 2026 20:06
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.

Deep-linked feature value renders as [object Object]

4 participants