fix(seer): invalidate seer projects list after adding project via modal#117868
Merged
Conversation
useMutateAutofixProject.onSettled was invalidating per-project queries and the legacy automation-settings endpoint, but not the org-level /organizations/$org/seer/projects/ infinite query that SeerProjectTable renders from. As a result, the /settings/seer/projects/ table would not show a newly added project until its 60s staleTime expired or the page was refreshed. Inline table edits (getMutateSeerProjectSettingsOptions) already invalidate this query correctly; this mirrors that same pattern in the modal mutation path. Co-Authored-By: sentry-junior[bot] <264270552+sentry-junior[bot]@users.noreply.github.com>
ryan953
approved these changes
Jun 16, 2026
ryan953
approved these changes
Jun 16, 2026
billyvg
added a commit
that referenced
this pull request
Jun 17, 2026
…al (#117868) ## Problem After adding a project to Autofix via the "Add Project" modal on `/settings/seer/projects/`, the table does not update to show the new project. It stays stale until the 60s `staleTime` expires or the page is refreshed. ## Root cause `useMutateAutofixProject.onSettled` invalidates several caches on success: - `projectSeerPreferencesApiOptions` (per-project legacy) - `bulkAutofixAutomationSettingsInfiniteOptions` (legacy `/autofix/automation-settings/` endpoint) - `getSeerProjectSettingsQueryOptions` (per-project `/projects/$org/$project/seer/settings/`) - `makeDetailedProjectQueryKey` But it does **not** invalidate `getInfiniteSeerProjectsSettingsQueryOptions` → `/organizations/$org/seer/projects/`, which is the exact infinite query `SeerProjectTable` fetches from. Inline table edits (`getMutateSeerProjectSettingsOptions`) already do this correctly. The modal mutation path (`useMutateAutofixProject`) was the gap. ## Fix Add the missing `queryClient.invalidateQueries` for the org-level seer projects infinite query in `useMutateAutofixProject.onSettled`, mirroring what `getMutateSeerProjectSettingsOptions` already does. --- [View Session in Sentry](https://sentry.sentry.io/traces/?project=4510944073809921&query=gen_ai.conversation.id%3A%22slack%3AC0AKG192UP3%3A1781646228.205609%22) Co-authored-by: sentry-junior[bot] <264270552+sentry-junior[bot]@users.noreply.github.com>
sehr-m
pushed a commit
that referenced
this pull request
Jun 23, 2026
…al (#117868) ## Problem After adding a project to Autofix via the "Add Project" modal on `/settings/seer/projects/`, the table does not update to show the new project. It stays stale until the 60s `staleTime` expires or the page is refreshed. ## Root cause `useMutateAutofixProject.onSettled` invalidates several caches on success: - `projectSeerPreferencesApiOptions` (per-project legacy) - `bulkAutofixAutomationSettingsInfiniteOptions` (legacy `/autofix/automation-settings/` endpoint) - `getSeerProjectSettingsQueryOptions` (per-project `/projects/$org/$project/seer/settings/`) - `makeDetailedProjectQueryKey` But it does **not** invalidate `getInfiniteSeerProjectsSettingsQueryOptions` → `/organizations/$org/seer/projects/`, which is the exact infinite query `SeerProjectTable` fetches from. Inline table edits (`getMutateSeerProjectSettingsOptions`) already do this correctly. The modal mutation path (`useMutateAutofixProject`) was the gap. ## Fix Add the missing `queryClient.invalidateQueries` for the org-level seer projects infinite query in `useMutateAutofixProject.onSettled`, mirroring what `getMutateSeerProjectSettingsOptions` already does. --- [View Session in Sentry](https://sentry.sentry.io/traces/?project=4510944073809921&query=gen_ai.conversation.id%3A%22slack%3AC0AKG192UP3%3A1781646228.205609%22) Co-authored-by: sentry-junior[bot] <264270552+sentry-junior[bot]@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
After adding a project to Autofix via the "Add Project" modal on
/settings/seer/projects/, the table does not update to show the new project. It stays stale until the 60sstaleTimeexpires or the page is refreshed.Root cause
useMutateAutofixProject.onSettledinvalidates several caches on success:projectSeerPreferencesApiOptions(per-project legacy)bulkAutofixAutomationSettingsInfiniteOptions(legacy/autofix/automation-settings/endpoint)getSeerProjectSettingsQueryOptions(per-project/projects/$org/$project/seer/settings/)makeDetailedProjectQueryKeyBut it does not invalidate
getInfiniteSeerProjectsSettingsQueryOptions→/organizations/$org/seer/projects/, which is the exact infinite querySeerProjectTablefetches from.Inline table edits (
getMutateSeerProjectSettingsOptions) already do this correctly. The modal mutation path (useMutateAutofixProject) was the gap.Fix
Add the missing
queryClient.invalidateQueriesfor the org-level seer projects infinite query inuseMutateAutofixProject.onSettled, mirroring whatgetMutateSeerProjectSettingsOptionsalready does.View Session in Sentry