Skip to content

ref(onboarding): Improve project polling mechanism #85918

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged

Conversation

ArthurKnaus
Copy link
Member

De-dupe logic
Stop polling once the project is determined active.

@ArthurKnaus ArthurKnaus requested a review from a team as a code owner February 26, 2025 08:30
@github-actions github-actions bot added the Scope: Frontend Automatically applied to PRs that change frontend components label Feb 26, 2025
Comment on lines +39 to +50
const {data: issues} = useApiQuery<Group[]>(
[`/projects/${organization.slug}/${project.slug}/issues/`],
{
staleTime: Infinity,
enabled: !!project.firstEvent,
}
);

const firstIssue =
!!project.firstEvent && issues
? issues.find((issue: Group) => issue.firstSeen === project.firstEvent)
: undefined;
Copy link
Member Author

Choose a reason for hiding this comment

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

Moved fetching the issue out of the hook as it is only relevant for this component. (which is not used in the project create flow)

Comment on lines 154 to -164
const shallProjectBeDeleted =
stepObj?.id === 'setup-docs' &&
recentCreatedProject &&
// if the project has received a first error, we don't delete it
recentCreatedProject.firstError === false &&
// if the project has received a first transaction, we don't delete it
recentCreatedProject.firstTransaction === false &&
// if the project has replays, we don't delete it
recentCreatedProject.hasReplays === false &&
// if the project has sessions, we don't delete it
recentCreatedProject.hasSessions === false &&
// if the project is older than one hour, we don't delete it
recentCreatedProject.olderThanOneHour === false;
Copy link
Member Author

Choose a reason for hiding this comment

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

de-duped and moved inside the hook

@ArthurKnaus ArthurKnaus merged commit ed6ca20 into master Feb 26, 2025
43 checks passed
@ArthurKnaus ArthurKnaus deleted the aknaus/ref/onboarding/improve-project-polling-mechanism branch February 26, 2025 13:13
ameliahsu pushed a commit that referenced this pull request Mar 5, 2025
De-dupe logic. Stop polling once the project is determined active.

- part of getsentry/projects#736
@github-actions github-actions bot locked and limited conversation to collaborators Mar 14, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
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