Skip to content

fix(preprod): Settings button redirect#107488

Merged
chromy merged 1 commit intomasterfrom
chromy/2026-02-03-fix-EME-812
Feb 3, 2026
Merged

fix(preprod): Settings button redirect#107488
chromy merged 1 commit intomasterfrom
chromy/2026-02-03-fix-EME-812

Conversation

@chromy
Copy link
Contributor

@chromy chromy commented Feb 3, 2026

@chromy chromy requested a review from a team as a code owner February 3, 2026 12:51
@linear
Copy link

linear bot commented Feb 3, 2026

@github-actions github-actions bot added the Scope: Frontend Automatically applied to PRs that change frontend components label Feb 3, 2026
<Layout.Title>Builds</Layout.Title>
<Layout.HeaderActions>
{projects.length === 1 && (
{singleProject && (
Copy link
Contributor

Choose a reason for hiding this comment

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

Settings button appears when multiple projects selected

Medium Severity

The condition controlling when the Settings button appears changed from projects.length === 1 to just singleProject. Since singleProject is derived from projects[0], it will be truthy whenever any project is selected and exists in the store—even when multiple projects are selected. This causes the Settings button to incorrectly appear and link to only the first project's settings when viewing multiple projects, which wasn't the original behavior.

Additional Locations (1)

Fix in Cursor Fix in Web

const projects = Array.from(new Set(projectList.filter(Boolean)));
const projectId = projects[0];
const singleProject =
projectId === undefined ? undefined : ProjectsStore.getById(projectId);
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 code uses ProjectsStore.getById(projectId) to fetch project details, but the projectId variable contains a project slug, not a numeric ID, causing the lookup to fail.
Severity: MEDIUM

Suggested Fix

Replace the call to ProjectsStore.getById(projectId) with ProjectsStore.getBySlug(projectId). This will correctly look up the project using its slug, ensuring the project object is found and related UI components render as expected.

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/buildList/buildList.tsx#L33

Potential issue: The `projectId` variable is derived from the `project` URL query
parameter, which contains the project slug. The code incorrectly attempts to fetch the
project object using `ProjectsStore.getById(projectId)`. Since `getById` expects a
numeric ID, this lookup will always fail and return `undefined`. Consequently, UI
elements like the Settings button in the build list and a LinkButton in the build
details header will not be rendered. Additionally, analytics events will be missing the
`project_slug`.

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.

size="sm"
icon={<IconSettings />}
aria-label={t('Settings')}
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.

Redundant optional chaining inside truthiness guard

Low Severity

project?.slug uses optional chaining inside a block that already guards with {project && (...)} on line 201. Since project is guaranteed to be truthy within this block, the ?. is redundant. Should be project.slug.

Fix in Cursor Fix in Web

@chromy chromy merged commit e4484fd into master Feb 3, 2026
69 of 71 checks passed
@chromy chromy deleted the chromy/2026-02-03-fix-EME-812 branch February 3, 2026 13:18
jaydgoss pushed a commit that referenced this pull request Feb 12, 2026
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