Skip to content

fix(preprod): Fix project slug/id confusion in a few places#107491

Merged
chromy merged 1 commit intomasterfrom
chromy/2026-02-03-fix-more
Feb 6, 2026
Merged

fix(preprod): Fix project slug/id confusion in a few places#107491
chromy merged 1 commit intomasterfrom
chromy/2026-02-03-fix-more

Conversation

@chromy
Copy link
Contributor

@chromy chromy commented Feb 3, 2026

No description provided.

@chromy chromy requested a review from a team as a code owner February 3, 2026 14:05
@github-actions github-actions bot added the Scope: Frontend Automatically applied to PRs that change frontend components label Feb 3, 2026
Copy link
Contributor

@cursor cursor bot left a comment

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.

Bugbot Autofix is OFF. To automatically fix reported issues with Cloud Agents, enable Autofix in the Cursor dashboard.

interface BuildLinkParams {
organizationSlug: string;
projectId: string;
projectId: number | string;
Copy link
Member

Choose a reason for hiding this comment

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

Bit confused by this change, won't it make it more confusing to get the id vs slug right? 😆

icon={<IconSettings />}
aria-label={t('Settings')}
to={`/settings/${organization.slug}/projects/${project?.slug}/mobile-builds/`}
to={`/settings/${organization.slug}/projects/${project.slug}/mobile-builds/`}
Copy link
Contributor

Choose a reason for hiding this comment

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

Bug: The component incorrectly uses ProjectsStore.getById() with a project slug, causing project to be undefined. The removal of optional chaining from project.slug will cause a crash.
Severity: CRITICAL

Suggested Fix

In buildDetailsHeaderContent.tsx, change the project lookup to use the correct method for a slug. Replace const project = ProjectsStore.getById(projectId); with const project = ProjectsStore.getBySlug(projectId); to ensure the project is found correctly.

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/preprod/buildDetails/header/buildDetailsHeaderContent.tsx#L206

Potential issue: In `buildDetailsHeaderContent.tsx`, the `project` object is fetched
using `ProjectsStore.getById(projectId)`. However, the `projectId` prop it receives from
the parent component (`buildDetails.tsx`) is actually a project slug string from the
URL, not a numeric ID. This causes the `getById` lookup to fail, making the `project`
variable `undefined`. The removal of optional chaining in the new code at line 206 means
that the attempt to access `project.slug` will result in a `TypeError`, causing the
application to crash when rendering the build details page.

@chromy chromy merged commit a8b8e45 into master Feb 6, 2026
59 checks passed
@chromy chromy deleted the chromy/2026-02-03-fix-more branch February 6, 2026 10:45
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