Refresh flags/segments on non-error live stream events#5889
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## v2 #5889 +/- ##
=======================================
Coverage 61.05% 61.05%
=======================================
Files 141 141
Lines 14211 14211
=======================================
Hits 8676 8676
Misses 4809 4809
Partials 726 726
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
erka
left a comment
There was a problem hiding this comment.
It's nice, but I'm not sure it solves the root cause of the issue. I suspect there is some async issue involved, like multiple pods running without sessionAffinity. @markphelps
There was a problem hiding this comment.
Verdict: approve
Clean, targeted improvement to live streaming invalidation logic: the new shared guard in streamingUtils.ts centralizes behavior and makes invalidation robust for all non-error events. Test coverage is present and specific, and no issues found across the diff. Approving as-is.
🤖 Automated review by the Flipt PR review agent.
Live Updates was receiving SSE events in the UI, but flag list state was not refreshing unless the event payload matched a single hardcoded type. As a result, users could see incoming stream activity while still seeing stale flag values in the list.
Streaming invalidation logic
type === 'refetchEvaluation'gating with a shared guard that invalidates cache for any non-null, non-error stream payload.errorevents out of invalidation to avoid unnecessary refetch churn.Shared stream-event guard
shouldInvalidateFromStreamEventinui/src/app/flags/streamingUtils.tsto centralize and clarify invalidation eligibility.Focused coverage
refetchEvaluationpayload → invalidatetype→ invalidateerrorpayload → do not invalidatenullpayload → do not invalidate