Description
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 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 thedetectFramework
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 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