Skip to content

Flaky app-with-src dev overlay recovery E2E can hard-navigate before Link hydration #2409

Closed

Description

@NathanDrake2406

Failure\nE2E (app-with-src) intermittently fails in tests/e2e/app-with-src/dev-overlay-recovery.spec.ts:\n\n\nExpected: true\nReceived: undefined\n at tests/e2e/app-with-src/dev-overlay-recovery.spec.ts:59\n\n\nThe assertion checks window.__vinextReloadCanary after navigating to /dev-overlay-recovery. When it is undefined, the browser performed a document navigation and lost the canary.\n\n## Evidence\n- CI run: https://github.com/cloudflare/vinext/actions/runs/28386821413/job/84103504889\n- Local reproduction: PLAYWRIGHT_PROJECT=app-with-src vp exec playwright test tests/e2e/app-with-src/dev-overlay-recovery.spec.ts --project=app-with-src failed on the first attempt with the same canary assertion, then passed on Playwright retry.\n\n## Likely cause\nThe test waits for the App Router navigation runtime, sets the reload canary, then clicks a <Link>. The runtime can exist before the specific Link click handler is hydrated. If the click wins that race, the browser follows the anchor as a hard navigation.\n\n## Fix direction\nDrive the test through runtime.functions.navigate("/dev-overlay-recovery") after App Router hydration instead of clicking the Link. That keeps the test focused on the soft-navigation recovery contract and removes the unrelated Link hydration race.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions