You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
See packages/server/lib/modes/index.ts - this file kicks off an initialization of the data context for the current mode and executes a script based on the mode to launch the UI. The promise is passed into those scripts.
In run.ts the promise is awaited prior to reporting a "ready" state, but in interactive.ts it is not. This allows the UI to initialize prior to the data context being ready which can result in odd race conditions since not all GQL queries are reactive/subscriptions.
We need to evaluate whether an await is needed in interactive.ts to ensure this data is resolved prior to launching UI, or whether this is intentionally ignored for performance reasons
Desired behavior
No response
Test code to reproduce
Add an arbitrary delay to packages/scaffold-config/src/detect.ts in the detectFramework function of several seconds
Create a new CT project but do not initialize with a cypress config: npm create vite@latest. Install dependencies in project.
Open project directly into CT mode: yarn dev --component --project <path to new project>
Delay will prevent auto-detection of CT framework from resolving prior to UI being initialized
Add an await of the _loading promise in interactive.ts
Repeat test above, observe framework is now properly resolved
Cypress Version
12.8.1
Node version
16.17.1
Operating System
any
Debug Logs
No response
Other
No response
The text was updated successfully, but these errors were encountered:
@mike-plummer FYI - We def do not want to await for this before launching the launchpad. We have found this to be is quite "slow" when analyzing our timings and this would make the open mode experience pretty "non-responsive".
@emilyrohrbough Was just going to ping you on this today to see if you remembered why it was structured that way 😆 . Thanks for the info (and amazing memory!). This was my assumption/fear, so we can work around it with a GQL subscription to get updated data once the context settles down behind the UI. I will plan to add some comments under this issue to interactive.ts to make it clear that we don't want to wait for that loading promise and why just for posterity
mike-plummer
changed the title
open mode does not wait for DataContext to intialize prior to launching UI
CT framework detection can fail due to open mode not waiting for DataContext to initialize
Apr 5, 2023
Current behavior
See
packages/server/lib/modes/index.ts
- this file kicks off an initialization of the data context for the current mode and executes a script based on the mode to launch the UI. The promise is passed into those scripts.In
run.ts
the promise is awaited prior to reporting a "ready" state, but ininteractive.ts
it is not. This allows the UI to initialize prior to the data context being ready which can result in odd race conditions since not all GQL queries are reactive/subscriptions.We need to evaluate whether an
await
is needed ininteractive.ts
to ensure this data is resolved prior to launching UI, or whether this is intentionally ignored for performance reasonsDesired behavior
No response
Test code to reproduce
Add an arbitrary delay to
packages/scaffold-config/src/detect.ts
in thedetectFramework
function of several secondsCreate a new CT project but do not initialize with a cypress config:
npm create vite@latest
. Install dependencies in project.Open project directly into CT mode:
yarn dev --component --project <path to new project>
Delay will prevent auto-detection of CT framework from resolving prior to UI being initialized
Add an
await
of the_loading
promise ininteractive.ts
Repeat test above, observe framework is now properly resolved
Cypress Version
12.8.1
Node version
16.17.1
Operating System
any
Debug Logs
No response
Other
No response
The text was updated successfully, but these errors were encountered: