-
Notifications
You must be signed in to change notification settings - Fork 3.4k
chore: (multi-domain) support multiple remote states #20752
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
chore: (multi-domain) support multiple remote states #20752
Conversation
* chore: [Multi-domain] Fix Flake when subdomain loads faster than toSpecBridge Command called. * Add Test * simplify test * Loading a cross domain page won't happen until the spec bridge is active (or a timeout will happen) * Update packages/driver/src/multi-domain/domain_fn.ts
…tance (#20653) * fix: make the primary domain communicator a singleton per cypress instance * leverage a factory to make typescript happy with their super() constructor rules * remove singleton instance from communicator and only bind message events once in the primary and per spec bridge. Forward all message events to the respective communicator instance, if available. * remove data.actual reference in primary communicator onMessage as it is no longer needed
* Better timeout error handling * quick fix, should re-visit * cancel dangling timeouts * re-broadcast the window load event. * clean up code and comment more * ignore better * PR updates * oops, didn't mean to enable this * Apply suggestions from code review Co-authored-by: Bill Glesias <bglesias@gmail.com> * moar pr updates * Apply suggestions from code review Co-authored-by: Chris Breiding <chrisbreiding@users.noreply.github.com> Co-authored-by: Bill Glesias <bglesias@gmail.com> * Fix test * message changes * message update Co-authored-by: Bill Glesias <bglesias@gmail.com> Co-authored-by: Chris Breiding <chrisbreiding@users.noreply.github.com>
* chore: [multi-domain] fix count-logs-by-test * add tests, fix preAttempts * formatting * remove redundant test
…iple-remote-states
…iple-remote-states
Test summaryRun details
View run in Cypress Dashboard ➡️ This comment has been generated by cypress-bot as a result of this project's GitHub integration settings. You can manage this integration in this project's settings in the Cypress Dashboard |
|
Thanks for taking the time to open a PR!
|
chrisbreiding
left a comment
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.
A lot cleaner with RemoteStates extracted. Very nice!
User facing changelog
n/a
Additional details
Added support for multiple remote states. This allows us to better determine when to inject multi-domain and to support carrying forward the
cy.visitauthoptions to subsequent requests. Multiple remote states works as follows:ready:for:domainevent receivedauthin therequest-middleware, the remote state for the requested origin is retrieved to determine ifauthneeds to be applied to the request.switchToDomaincommand ends, the origin is removed from the origin stack but the remote state is not removed since the user could make another request to that origin that would need the state appliedswitchToDomainvalidation fails or if the fallbackswitchToDomaintimeout occurs, the response is released but the remote state and origin are not addedHow has the user experience changed?
authoptions are now applied to subsequent requests in a secondary originPR Tasks
cypress-documentation?type definitions?cypress.schema.json?