Skip to content

fix(dashboard): invalidate flag list with route website id - #665

Open
r69shabh wants to merge 1 commit into
databuddy-analytics:stagingfrom
r69shabh:fix/dashboard-flags-list-invalidation
Open

fix(dashboard): invalidate flag list with route website id#665
r69shabh wants to merge 1 commit into
databuddy-analytics:stagingfrom
r69shabh:fix/dashboard-flags-list-invalidation

Conversation

@r69shabh

@r69shabh r69shabh commented Aug 22, 2026

Copy link
Copy Markdown

Fixes #664

Summary

StatusToggle and FlagActions in the flags list invalidated the flags.list query with websiteId: flag.websiteId ?? "", but the query is cached under the route param website id. Element-wise key matching means any flag with a null websiteId would never trigger a refetch — leaving stale On/Off/Archived status in the list after mutations.

Changes

  • FlagsListProps gains a required websiteId: string; threaded through FlagRowStatusToggle / FlagActions.
  • Both invalidation calls now use that prop.
  • page.tsx passes its route-param websiteId — identical to what the list query was keyed with.

Verification

  • tsc --noEmit in apps/dashboard: clean
  • No other FlagsList call sites; no runtime behavior change for current website-scoped flags

Note: repo-wide check-types/test hooks currently fail on staging itself due to the missing analyticsDateRangeSchema export (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.

  • FlagsListProps now requires websiteId and passes it through FlagRow to StatusToggle and FlagActions.
  • Both invalidation calls now use the route websiteId, matching the orpc.flags.list cache key.
  • page.tsx passes its route websiteId. No other FlagsList call sites. No runtime behavior change beyond correct refetch.

Written for commit 864ca07. Summary will update on new commits.

Review in cubic

@vercel

vercel Bot commented Aug 22, 2026

Copy link
Copy Markdown

@r69shabh is attempting to deploy a commit to the Databuddy OSS Team on Vercel.

A member of the Team first needs to authorize it.

@vercel
vercel Bot temporarily deployed to Preview – documentation August 22, 2026 13:26 Inactive
@vercel

vercel Bot commented Aug 22, 2026

Copy link
Copy Markdown

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

1 Skipped Deployment
Project Deployment Actions Updated (UTC)
documentation Skipped Skipped Aug 22, 2026 1:26pm

@coderabbitai

coderabbitai Bot commented Aug 22, 2026

Copy link
Copy Markdown
Contributor

Important

Review skipped

Auto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Repository UI

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: 2126190b-c70b-438b-a6c9-39828f72567c

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

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.

@greptile-apps

greptile-apps Bot commented Aug 22, 2026

Copy link
Copy Markdown
Contributor

Greptile Summary

This PR aligns status-toggle and archive mutation invalidation with the route-scoped key used by the flags list query.

  • Adds a required websiteId property to FlagsList and threads it through each flag row.
  • Uses the route website ID when invalidating flags.list after status mutations.
  • Passes the page’s route-derived website ID into the list.

Confidence Score: 5/5

The PR appears safe to merge, with the changed invalidations consistently targeting the route-scoped flags list.

The only FlagsList caller passes the identifier used by its list query, and the website-scoped RPC list cannot return flags belonging to a different website.

Important Files Changed

Filename Overview
apps/dashboard/app/(main)/websites/[id]/flags/_components/flags-list.tsx Threads the route website ID to status mutations so their invalidation key matches the displayed list query; no actionable defect found.
apps/dashboard/app/(main)/websites/[id]/flags/page.tsx Supplies the same route-derived website ID used by the list query to FlagsList; no actionable defect found.

Reviews (1): Last reviewed commit: "fix(dashboard): invalidate flag list wit..." | Re-trigger Greptile

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant