Skip to content

fix(onboarding): Refresh SCM data on return - #121902

Open
jaydgoss wants to merge 1 commit into
masterfrom
fix/refresh-scm-data-on-return
Open

fix(onboarding): Refresh SCM data on return#121902
jaydgoss wants to merge 1 commit into
masterfrom
fix/refresh-scm-data-on-return

Conversation

@jaydgoss

Copy link
Copy Markdown
Member

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. useScmProviders and useScmRepos
keep 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

@linear-code

linear-code Bot commented Aug 12, 2026

Copy link
Copy Markdown

VDY-157

@github-actions github-actions Bot added the Scope: Frontend Automatically applied to PRs that change frontend components label Aug 12, 2026
Refetch SCM providers, integrations, and repositories when shared SCM flows remount or regain window focus.

Refs VDY-157
@jaydgoss
jaydgoss force-pushed the fix/refresh-scm-data-on-return branch from c07be91 to 804646f Compare August 12, 2026 23:03
@jaydgoss
jaydgoss marked this pull request as ready for review August 12, 2026 23:11
@jaydgoss
jaydgoss requested review from a team August 12, 2026 23:11

@cursor cursor Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Fix All in Cursor

❌ 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,

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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)
Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit 804646f. Configure here.

await waitFor(() => expect(request).toHaveBeenCalled());
});

it('refetches repos when the window regains focus', async () => {

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

not worth testing if react-query is working

);
});

it('refetches providers and integrations when the window regains focus', async () => {

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same here

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

Labels

Scope: Frontend Automatically applied to PRs that change frontend components

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants