Repository navigation
perf(Onboarding): Show the page while setup runs - #9234
talissoncosta wants to merge 2 commits into
Conversation
…on after it Co-Authored-By: Claude Opus 5.5 <[email protected]>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
There was a problem hiding this comment.
1 issue found across 10 files
Confidence score: 3/5
- The detached request can race the organisation refresh in
bootstrapOnboarding.ts, leaving the legacyProjectStorewithout Production when the user enters the app. Ensure bootstrap waits for the request or refreshes the legacy store after it completes.
Prompt for AI agents (unresolved issues)
Check if these issues are valid — if so, understand the root cause of each and fix them. When an issue isn't valid or won't be fixed in this PR, reply in its thread with the reason and then resolve the thread. If appropriate, use sub-agents to investigate and fix each issue separately.
<file name="frontend/web/components/pages/onboarding/hooks/bootstrapOnboarding.ts">
<violation number="1" location="frontend/web/components/pages/onboarding/hooks/bootstrapOnboarding.ts:161">
P2: The detached request can finish after `bootstrapOnboarding` refreshes the organisation; entering the app then leaves the legacy `ProjectStore` without Production. The mutation only invalidates RTK environment tags, so this store stays stale until another project reload; refresh it when Production creation completes.</violation>
</file>
Reply with feedback, questions, or to request a fix.
Turn on auto-fix | Re-trigger cubic
| createEnvironment(store, project.id, PROD_ENVIRONMENT_NAME).catch(() => { | ||
| // A missing Production environment doesn't block onboarding. | ||
| }) |
There was a problem hiding this comment.
P2: The detached request can finish after bootstrapOnboarding refreshes the organisation; entering the app then leaves the legacy ProjectStore without Production. The mutation only invalidates RTK environment tags, so this store stays stale until another project reload; refresh it when Production creation completes.
Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. When an issue isn't valid or won't be fixed in this PR, reply in its thread with the reason and then resolve the thread. At frontend/web/components/pages/onboarding/hooks/bootstrapOnboarding.ts, line 161:
<comment>The detached request can finish after `bootstrapOnboarding` refreshes the organisation; entering the app then leaves the legacy `ProjectStore` without Production. The mutation only invalidates RTK environment tags, so this store stays stale until another project reload; refresh it when Production creation completes.</comment>
<file context>
@@ -157,6 +157,10 @@ async function setUpNewProject(
})
API.trackEvent(Constants.events.CREATE_FIRST_FEATURE)
+ // Not awaited: the page only needs Development.
+ createEnvironment(store, project.id, PROD_ENVIRONMENT_NAME).catch(() => {
+ // A missing Production environment doesn't block onboarding.
+ })
</file context>
| createEnvironment(store, project.id, PROD_ENVIRONMENT_NAME).catch(() => { | |
| // A missing Production environment doesn't block onboarding. | |
| }) | |
| createEnvironment(store, project.id, PROD_ENVIRONMENT_NAME) | |
| .then(() => AppActions.getProject(project.id)) | |
| .catch(() => { | |
| // A missing Production environment doesn't block onboarding. | |
| }) |
There was a problem hiding this comment.
Not changing this one. ProjectStore only loads a project when the user enters it, and fetches its environments fresh then. It's stale only if the user enters the project in the second or so before Production finishes, and the next project load fixes it. Refreshing the Flux store from onboarding could swap in the wrong project, which is worse.
There was a problem hiding this comment.
No blocking issues remain. Requires human review: Onboarding now renders immediately with placeholders while setup runs, but Production environment creation becomes fire-and-forget, accepting silent failure and no recreation on resume; the stale ProjectStore finding is disputed rather than fixed.
- Disable Skip until setup is ready, so it can't fall back to / - Report Production environment failures to Sentry - Render inline skeletons as span with role=status Co-Authored-By: Claude Opus 5.5 <[email protected]>
There was a problem hiding this comment.
0 issues found across 4 files (changes from recent commits).
Confidence score: 5/5
- Automated review surfaced no issues in the provided summaries.
- No files require special attention.
Requires human review: Auto-approval blocked by 1 unresolved issue from previous reviews.
Turn on auto-fix | Re-trigger cubic
Thanks for submitting a PR! Please check the boxes below:
docs/if required so people know about the feature.Changes
Contributes to ENG-1258. Stacked on #9200.
The onboarding page showed a loader until setup finished, about 3.4s after #9200. The goal is for the page to feel ready in under a second.
create_initial_feature_states_for_environment), so it still gets the flag.Trade-off: if creating Production fails, it fails silently, and resuming doesn't recreate it. Resuming only ensures Development, because creating a missing Production would add one to returning users' projects that use their own environment names.
How did you test this code?
Environment.create_feature_states).