-
-
Notifications
You must be signed in to change notification settings - Fork 4.3k
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
ref(onboarding): Improve project polling mechanism #85918
Conversation
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; |
There was a problem hiding this comment.
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)
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; |
There was a problem hiding this comment.
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
De-dupe logic. Stop polling once the project is determined active. - part of getsentry/projects#736
De-dupe logic
Stop polling once the project is determined active.