Skip to content

fix(ui): seed RTK Query cache after create/update mutations#6217

Open
jgaul3 wants to merge 1 commit into
flipt-io:v2from
jgaul3:jg/use-response-revision
Open

fix(ui): seed RTK Query cache after create/update mutations#6217
jgaul3 wants to merge 1 commit into
flipt-io:v2from
jgaul3:jg/use-response-revision

Conversation

@jgaul3

@jgaul3 jgaul3 commented Jul 16, 2026

Copy link
Copy Markdown
Contributor

Description

When I use flipt, I find I have to refresh a time or two after making changes for those changes to be reflected in the UI. I'm quite certain this is a read-after-write bug arising from using invalidatesTags rather than updating those tags. This PR updates them to generally use onQueryStarted instead.

This applies to creating, updating, and deleting flags and segments, as well as creating branches.

I tested things out locally but since it's partially a network thing that's mostly to confirm that basic processes still work.

Signed-off-by: Jon Gaul <jgaul3@gmail.com>
@jgaul3
jgaul3 requested a review from a team as a code owner July 16, 2026 04:59
@dosubot dosubot Bot added the size:L This PR changes 100-499 lines, ignoring generated files. label Jul 16, 2026

@github-actions github-actions Bot 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.

Verdict: approve

This PR cleanly replaces RTK Query tag invalidation with explicit cache seeding via onQueryStarted to fix the read-after-write consistency issues described. The pattern is applied consistently across flags, segments, and branch environments; return types are corrected to match actual API responses; duplication is reduced with enrichFlag/enrichSegment helpers; and Playwright tests are strengthened to verify immediate UI consistency. No issues found.

🤖 Automated review by the Flipt PR review agent.

@codecov

codecov Bot commented Jul 16, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 62.27%. Comparing base (555c557) to head (7d200dc).
⚠️ Report is 3 commits behind head on v2.

Additional details and impacted files
@@           Coverage Diff           @@
##               v2    #6217   +/-   ##
=======================================
  Coverage   62.27%   62.27%           
=======================================
  Files         145      145           
  Lines       14815    14815           
=======================================
  Hits         9226     9226           
  Misses       4829     4829           
  Partials      760      760           
Flag Coverage Δ
integrationtests 33.50% <ø> (ø)
unittests 53.85% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ 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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:L This PR changes 100-499 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant