-
Notifications
You must be signed in to change notification settings - Fork 3.3k
internal: show loading and error statuses in studio panel, add download timeout #31633
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
Conversation
cypress
|
Project |
cypress
|
Branch Review |
studio-error-handling
|
Run status |
|
Run duration | 11m 11s |
Commit |
|
Committer | astone123 |
View all properties for this run ↗︎ |
Test results | |
---|---|
|
0
|
|
1
|
|
0
|
|
0
|
|
685
|
View all changes introduced in this branch ↗︎ |
UI Coverage
37.62%
|
|
---|---|
|
131
|
|
79
|
Accessibility
92.36%
|
|
---|---|
|
3 critical
8 serious
1 moderate
1 minor
|
|
429
|
Co-authored-by: Ryan Manuel <ryanm@cypress.io>
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.
Pull Request Overview
This PR improves the handling of the studio panel by adding loading and error states, integrating a new "INITIALIZING" status, and implementing a download timeout for fetching the studio bundle. Key changes include:
- Enhancements to the studio lifecycle status and error handling (e.g., adding the "INITIALIZING" status).
- Updates to both server and GraphQL layers to support real-time studio status changes.
- Adjustments in the UI and test suites to reflect the new studio loading behavior.
Reviewed Changes
Copilot reviewed 13 out of 13 changed files in this pull request and generated 1 comment.
Show a summary per file
File | Description |
---|---|
packages/types/src/studio/index.ts | Added "INITIALIZING" status in studio status definitions. |
packages/server/test/unit/cloud/api/studio/get_and_initialize_studio_manager_spec.ts | Updated tests to use the new "shouldEnableStudio" parameter and added a timeout test case. |
packages/server/test/unit/StudioLifecycleManager_spec.ts | Added tests for cloudStudioEnabled and status tracking with the new "INITIALIZING" state. |
packages/server/lib/project-base.ts | Changed logic to check cloudStudioEnabled instead of legacy env variable checks. |
packages/server/lib/cloud/api/studio/get_and_initialize_studio_manager.ts | Added download timeout logic and new parameters to support it. |
packages/server/lib/StudioLifecycleManager.ts | Improved status tracking and proxy setup to emit status changes asynchronously. |
packages/graphql/src/schemaTypes/* & schemas/schema.graphql | Added subscription and query fields to expose studio status and cloudStudioEnabled. |
packages/data-context/src/actions/DataEmitterActions.ts | Added a new emitter method for studioStatusChange. |
packages/app/src/studio/StudioPanel.vue | Updated panel components to differentiate between loading, error, and normal states using the new statuses. |
packages/app/src/runner/SpecRunnerOpenMode.vue | Integrated subscription to studio status changes and updated usage in UI components. |
packages/app/cypress/e2e/studio/studio.cy.ts | Adjusted E2E tests for legacy vs. cloud studio UI behavior and loading state validation. |
Comments suppressed due to low confidence (1)
packages/app/src/studio/StudioPanel.vue:53
- [nitpick] It may be beneficial to restrict the 'studioStatus' prop to a union type of the expected status values (e.g., 'INITIALIZING' | 'IN_ERROR' | 'ENABLED') rather than a generic string, enhancing type safety and clarity.
studioStatus: string | null
packages/server/lib/cloud/api/studio/get_and_initialize_studio_manager.ts
Show resolved
Hide resolved
packages/graphql/src/schemaTypes/objectTypes/gql-Subscription.ts
Outdated
Show resolved
Hide resolved
Have you given any thought into how this would work? |
With this, do we want to update |
@mschile yeah, basically we would make a mutation to call initialize on the studio lifecycle manager again. The studio status would go back to The outstanding questions I have are:
|
I'm not opposed to this, but I don't see how it would change the behavior here |
I ran this and noticed a couple of things. I added a 60 second delay (in code) to getting the studio bundle and when I go to Studio, I see the loading screen as expected, but I see this in the console: ![]() and then studio AI is disabled: ![]() Seems like we need to handle the studio init differently with this change: https://github.com/cypress-io/cypress/blob/develop/packages/server/lib/project-base.ts#L405 |
@ryanthemanuel I fixed this in 317f1e9 - the console error is expected, since we want to track how often people are opening studio when it hasn't loaded yet. But it should correctly enable AI access now |
Released in This comment thread has been locked. If you are still experiencing this issue after upgrading to |
Additional details
This PR makes updates to the studio lifecycle to surface errors in a better way. Right now, if studio errors out or the user gets to it before it loads, we just don't show the Studio Beta button to open it. This can lead to some confusion in the user experience.
This PR makes the following changes:
cloudStudioEnabled
field so that the UI knows whether or not cloud studio is supposed to show upcloudStudioEnabled
INITIALIZING
status for studio so that the UI can show a loading state if the user reaches studio before it is downloadedIN_ERROR
status, and the UI will display an error in the panel letting the user know that there was an error loading studio.Steps to test
I tested this by slowing my Mac's network connection down using Network Link Conditioner. I set my network to 1kbps download speed and opened Cypress and verified the following with cloud studio enabled:
How has the user experience changed?
The user is able to open the cloud studio panel regardless of whether or not studio has finished downloading
PR Tasks
cypress-documentation
?type definitions
?