fix(onboarding): Refresh SCM data on return - #121902
Conversation
Refetch SCM providers, integrations, and repositories when shared SCM flows remount or regain window focus. Refs VDY-157
c07be91 to
804646f
Compare
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Want reviews to match your repository better? Bugbot Learning can learn team-specific rules from PR activity. A team admin can enable Learning in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit 804646f. Configure here.
| staleTime: 0, | ||
| } | ||
| ), | ||
| refetchOnWindowFocus: true, |
There was a problem hiding this comment.
Focus refetch errors replace connect UI
Medium Severity
refetchOnWindowFocus can fail after retries while cached provider and integration data is still present. TanStack Query then sets isError without clearing data, and ScmIntegrationConnect treats that as fatal, so a blip on tab return or OAuth callback replaces the in-progress connect UI with the error screen.
Additional Locations (1)
Reviewed by Cursor Bugbot for commit 804646f. Configure here.
| await waitFor(() => expect(request).toHaveBeenCalled()); | ||
| }); | ||
|
|
||
| it('refetches repos when the window regains focus', async () => { |
There was a problem hiding this comment.
not worth testing if react-query is working
| ); | ||
| }); | ||
|
|
||
| it('refetches providers and integrations when the window regains focus', async () => { |


TLDR
SCM provider, integration, and repository data now refresh when onboarding and project
creation remount or regain window focus.
Details
Sentry disables window-focus refetches globally.
useScmProvidersanduseScmReposkeep their data immediately stale and opt into focus refetching, so provider installations
and repository permission changes appear after users return without a manual reload.
Refs VDY-157