fix(dashboard): invalidate flag list with route website id - #665
Conversation
|
@r69shabh is attempting to deploy a commit to the Databuddy OSS Team on Vercel. A member of the Team first needs to authorize it. |
|
The latest updates on your projects. Learn more about Vercel for GitHub. 1 Skipped Deployment
|
|
Important Review skippedAuto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Repository UI Review profile: ASSERTIVE Plan: Pro Plus Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
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. Comment |
Greptile SummaryThis PR aligns status-toggle and archive mutation invalidation with the route-scoped key used by the flags list query.
Confidence Score: 5/5The PR appears safe to merge, with the changed invalidations consistently targeting the route-scoped flags list. The only Important Files Changed
Reviews (1): Last reviewed commit: "fix(dashboard): invalidate flag list wit..." | Re-trigger Greptile |
Fixes #664
Summary
StatusToggleandFlagActionsin the flags list invalidated theflags.listquery withwebsiteId: flag.websiteId ?? "", but the query is cached under the route param website id. Element-wise key matching means any flag with anullwebsiteIdwould never trigger a refetch — leaving stale On/Off/Archived status in the list after mutations.Changes
FlagsListPropsgains a requiredwebsiteId: string; threaded throughFlagRow→StatusToggle/FlagActions.page.tsxpasses its route-paramwebsiteId— identical to what the list query was keyed with.Verification
tsc --noEmitinapps/dashboard: cleanFlagsListcall sites; no runtime behavior change for current website-scoped flagsNote: repo-wide
check-types/testhooks currently fail onstagingitself due to the missinganalyticsDateRangeSchemaexport (tracked in #662) — unrelated to this change.Summary by cubic
Invalidate the flags list using the route website id so mutations refetch the list; previously invalidation used
flag.websiteId ?? "", leaving flags with null website id stale. Addresses #664.FlagsListPropsnow requireswebsiteIdand passes it throughFlagRowtoStatusToggleandFlagActions.websiteId, matching theorpc.flags.listcache key.page.tsxpasses its routewebsiteId. No otherFlagsListcall sites. No runtime behavior change beyond correct refetch.Written for commit 864ca07. Summary will update on new commits.