feat(issues): Clean up empty state project lookup#114652
Open
feat(issues): Clean up empty state project lookup#114652
Conversation
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>
| sentFirstEvent, | ||
| firstEventProjects: projects, | ||
| }); | ||
| if (!sentFirstEventQuery.data?.sentFirstEvent && projectsQuery.data?.length) { |
Contributor
There was a problem hiding this comment.
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.