Skip to content

Conversation

@scttcper
Copy link
Member

No description provided.

@scttcper scttcper requested a review from a team November 11, 2025 00:47
@github-actions github-actions bot added the Scope: Frontend Automatically applied to PRs that change frontend components label Nov 11, 2025
@billyvg
Copy link
Member

billyvg commented Nov 12, 2025

@sentry review

Comment on lines +82 to +85
const tabParam = decodeScalar(location.query.tab) as Tab | undefined;
const tab: Tab = tabParam && TABS.includes(tabParam) ? tabParam : 'repos';
const {integrationId, providerKey} = useParams<{
integrationId: string;
Copy link

Choose a reason for hiding this comment

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

The location.query.tab is being read and type-cast to Tab | undefined. However, after the cast, it's being validated against TABS.includes(tabParam). Consider using proper type narrowing to avoid potential issues. Currently, if decodeScalar returns undefined, the condition will short-circuit correctly, but making this more explicit would improve code clarity.
Severity: MEDIUM

💡 Suggested Fix

Suggested change
const tabParam = decodeScalar(location.query.tab) as Tab | undefined;
const tab: Tab = tabParam && TABS.includes(tabParam) ? tabParam : 'repos';
const {integrationId, providerKey} = useParams<{
integrationId: string;
const tabParam = (decodeScalar(location.query.tab) ?? '') as Tab | undefined;
const tab: Tab = (tabParam && TABS.includes(tabParam as Tab)) ? (tabParam as Tab) : 'repos';

Did we get this right? 👍 / 👎 to inform future reviews.

Reference_id: 2624811

Comment on lines 145 to 149
})
);
}
}, [router, organization, providerKey]);
}, [navigate, organization, providerKey]);

Copy link

Choose a reason for hiding this comment

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

The component now uses navigate() from useNavigate() hook instead of router.push(). Ensure that all navigation calls are using the correct object format. At lines 145-149 and 164-167, navigate() is being called with location objects containing pathname and query properties. Verify that the navigate() function correctly handles the query property (as it's a React Router v6 pattern, which typically uses search parameters instead). This might need adjustment depending on how the router handles query strings.
Severity: MEDIUM

🤖 Prompt for AI Agent

Review the code at the location below. A potential bug has been identified by an AI
agent.
Verify if this is a real issue. If it is, propose a fix; if not, explain why it's not
valid.

Location:
static/app/views/settings/organizationIntegrations/configureIntegration.tsx#L145-L149

Potential issue: The component now uses `navigate()` from `useNavigate()` hook instead
of `router.push()`. Ensure that all navigation calls are using the correct object
format. At lines 145-149 and 164-167, `navigate()` is being called with location objects
containing `pathname` and `query` properties. Verify that the `navigate()` function
correctly handles the `query` property (as it's a React Router v6 pattern, which
typically uses search parameters instead). This might need adjustment depending on how
the router handles query strings.

Did we get this right? 👍 / 👎 to inform future reviews.

Reference_id: 2624811

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.

3 participants