Skip to content

Fix e2e hang: rename Vite DevTools client-context global + bump for upstream auth-disable fix (vitejs/devtools#539) #1067

Description

@antfubot

Summary

The e2e suite hangs (15-min CI cap) since the Vite DevTools v0.5.0 / Devframe v0.9.2 migration (#1065). Root cause is two-layered; the blocking layer is an upstream@vitejs/devtools regression.

Layer 1 — renamed client-context global (in-repo, trivial)

The v0.5 migration renamed the host-page global window.__VITE_DEVTOOLS_CLIENT_CONTEXT__window.__DEVFRAME_HUB_CLIENT_CONTEXT__. Our e2e still waits on the old name, so ensureDockReady blocks 30s on a never-defined global and every DevTools-dependent test times out.

The new global has the same shape we rely on (.rpc, .rpc.isTrusted, .rpc.events, .docks.entries), so the fix is a mechanical rename across 4 files / 13 refs:

  • tests/e2e/fixtures/devtools.ts
  • tests/e2e/specs/devtools.spec.ts
  • tests/e2e/specs/data-inspector.spec.ts
  • tests/e2e/specs/code-server.spec.ts

Layer 2 — auth-disable no longer trusts the client (upstream, blocking)

Filed upstream: vitejs/devtools#539.

VITE_DEVTOOLS_DISABLE_CLIENT_AUTH=true (used by our e2e webServer) and clientAuth: false no longer mark the client RPC session trusted in @vitejs/devtools@0.5.0: createDevToolsContext registers the interactive-auth handler on the context RPC unconditionally, which pre-empts devframe's auth:false auto-trust shim. The client connects and gets docks, but isTrusted stays false, so the DevTools UI shows the auth prompt and never mounts. This blocks the e2e even after the Layer 1 rename.

Bump plan (do in order, once upstream ships)

  1. Blocked onDisabling client auth (clientAuth:false / VITE_DEVTOOLS_DISABLE_CLIENT_AUTH) no longer trusts the client in 0.5 vitejs/devtools#539. Track its fix/release.
  2. When released, bump the vite-devtools catalog ref in pnpm-workspace.yaml (currently ^0.5.0) to the fixed @vitejs/devtools / @vitejs/devtools-kit version; bump the devframe ref (^0.9.2) too if the fix lands in devframe. Refresh the lockfile.
  3. Apply the Layer 1 global rename (__VITE_DEVTOOLS_CLIENT_CONTEXT____DEVFRAME_HUB_CLIENT_CONTEXT__) across the 4 test files above.
  4. Verify pnpm test:e2e:dev and pnpm test:e2e:built go green locally, then in CI.
  5. If upstream changes the trust/connection API shape, adjust ensureDockReady accordingly (the fixture also emits rpc:is-trusted:updated and reads docks.entries — re-verify both against the shipped version).

Interim

Until the upstream fix lands, e2e will keep hitting the 15-minute cap on every branch (it already does on main). Consider temporarily marking the e2e job non-required / allowed-to-fail so it stops masking other signal, and revert that once the bump is in.

Diagnosis provenance

Reproduced on a clean main checkout; instrumented @vitejs/devtools confirmed authDisabled is computed true yet the context RPC still runs the interactive-auth gate (requestTrust()false, isTrusted stays false, client iframe never attaches). Full evidence in vitejs/devtools#539.

Investigation and issue authored with the help of an agent.

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