Skip to content

ref(onboarding): Improve project polling mechanism - #85918

Merged
ArthurKnaus merged 2 commits into
masterfrom
aknaus/ref/onboarding/improve-project-polling-mechanism
Feb 26, 2025
Merged

ref(onboarding): Improve project polling mechanism#85918
ArthurKnaus merged 2 commits into
masterfrom
aknaus/ref/onboarding/improve-project-polling-mechanism

Conversation

@ArthurKnaus

Copy link
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
@ArthurKnaus
ArthurKnaus deleted the aknaus/ref/onboarding/improve-project-polling-mechanism branch February 26, 2025 13:13
@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