fix(e2e): isolate the OIDC consent drive and guard the re-save #425
Loading…
Reference in a new issue
No description provided.
Delete branch "fix/BUNYIP-402-e2e-setup-post-consent-resave"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
The
setupproject failed in e2e run #2175 atglobal.setup.ts:207withbrowserContext.storageState: Target page, context or browser has been closedand anavigating to <redirect_uri>call log, taking all 11 dependent specs with it. The consent drive had just followed/oauth2/authorizestraight through to the registered redirect_uri (a mokosh app callback we neither control nor need: the OP records the grant server-side before it 302s, and thecodeis worthless to setup), and loading that foreign page killed the browser. It is the same BUNYIP-148 chromium death signature the config already documents, now on a page we never needed to render.Two guards. First, drive consent on a throwaway page in the SAME context: cookies are context-scoped so the grant still lands on the session setup persists, but a renderer death on the callback can no longer reach the page the rest of setup depends on. Verified locally against a fake OP: the Allow POST fires once, crashing the throwaway page's renderer leaves the main page and the context alive, and the post-consent
storageStatestill carries the cookies set during consent. Second, wrap the post-consent re-save: it is best-effort by design (both.auth/artifacts are written before the consent drive, and consent grants live server-side), so a dead context must warn rather than fail setup. A local repro confirms the exact run #2175 error is catchable.Stubbing the callback away with
page.routewas tried and rejected: Playwright 1.60 applies route handlers only to the request that starts a chain, not to the target of a server redirect, so the foreign page loads regardless. That finding is recorded in the code comment and in docs/e2e.md, which also stated that the redirect_uri "is never loaded" - true for the request-context specs, false for the browser-driven setup project.#BUNYIP-402