Skip to content

feat(issues): Clean up empty state project lookup#114652

Open
scttcper wants to merge 2 commits intomasterfrom
scttcper/no-groups-query
Open

feat(issues): Clean up empty state project lookup#114652
scttcper wants to merge 2 commits intomasterfrom
scttcper/no-groups-query

Conversation

@scttcper
Copy link
Copy Markdown
Member

@scttcper scttcper commented May 1, 2026

Reworks the issues empty state handler while cleaning up the slow project lookup path.

removes a class component and speeds up the project query by passing collapse query parameters and moves it to react query.

The issues empty state was always fetching one project summary, even when the result was only needed for the awaiting-events path. That hit the project summary serializer and could run the latest deploys query for no useful reason.

Move the component to React Query, only fetch the project when we're actually rendering AwaitingEvents, and collapse latestDeploys when we do need it.

Co-Authored-By: Codex GPT-5 <noreply@openai.com>
@github-actions github-actions Bot added the Scope: Frontend Automatically applied to PRs that change frontend components label May 1, 2026
@scttcper scttcper changed the title perf(issues): Avoid latest deploys in empty state perf(issues): Clean up empty state project lookup May 1, 2026
@scttcper scttcper changed the title perf(issues): Clean up empty state project lookup feat(issues): Clean up empty state project lookup May 1, 2026
@scttcper scttcper marked this pull request as ready for review May 1, 2026 22:50
@scttcper scttcper requested a review from a team as a code owner May 1, 2026 22:50
@scttcper scttcper requested review from a team May 1, 2026 22:50
sentFirstEvent,
firstEventProjects: projects,
});
if (!sentFirstEventQuery.data?.sentFirstEvent && projectsQuery.data?.length) {
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.

Bug: The 'Waiting for events' state is not shown for new organizations with no projects because the logic incorrectly requires at least one project to exist.
Severity: MEDIUM

Suggested Fix

Modify the conditional statement at line 125 to only check the status of sentFirstEventQuery.data?.sentFirstEvent. Remove the projectsQuery.data?.length check to ensure the 'Waiting for events' state is displayed for organizations that have not sent an event, regardless of project count. The line should be changed from if (!sentFirstEventQuery.data?.sentFirstEvent && projectsQuery.data?.length) to if (!sentFirstEventQuery.data?.sentFirstEvent).

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/issueList/noGroupsHandler/index.tsx#L125

Potential issue: The conditional logic to display the 'Waiting for events' state is
incorrect. The check at line 125 requires both that the organization has not sent its
first event (`sentFirstEvent` is false) and that the organization has at least one
project (`projectsQuery.data?.length` is truthy). In the scenario where a new
organization has not yet sent an event and has no projects created, the second part of
the condition fails. This causes the UI to incorrectly render an 'EmptyResult' message
('No issues match your search') instead of the expected 'AwaitingEvents' state, which
would guide the user to create their first event.

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

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.

1 participant