Comfy-Org / Comfy-Org/ComfyUI_frontend

Validate dev-server proxy target before reusing a recorder server

Open
#16,576 0 comments 0 reactions 1 assignee Claimed by @christian-byrne View on GitHub
Dominant language
TypeScript
Stars
2k
Forks
702
Avg merge
1d 7h
Merged PRs (30d)
490

Description

## Summary

The test recorder can reuse an already-running Vite dev server. `probeDevServer` currently confirms that a Vite server is reachable, but it does not expose the active proxy target. As a result, the recorder can select a storage-state key for custom backend A while it records against a reused server configured for custom backend B.

## Required changes

Extend dev-server probing so it can expose the active proxy target or another reliable distribution/backend identity.

Update `ensureDevServer` in the dev-server manager to compare the requested distribution/backend with the reused server identity before the recorder loads or saves storage state.

If the identity differs, do not reuse the server. Start a correctly configured server or return a clear error, according to the established dev-server lifecycle behavior.

## Rationale

Storage-state isolation depends on the active backend, not only on the requested distribution. Reusing a server with a different proxy target can persist cookies for one backend under another backend's storage-state key. A later recording can then replay those cookies against the wrong backend.

## Affected areas

- `tools/test-recorder/src/devserver/manager.ts`
- `probeDevServer`
- `ensureDevServer`
- Test-recorder runner integration and tests for dev-server reuse

## Acceptance criteria

- The probe exposes a reliable active proxy target or backend identity for a reusable dev server.
- `ensureDevServer` validates the requested backend before it reuses a running dev server.
- A backend mismatch cannot load or save storage state under the requested backend's key.
- Tests cover matching and mismatching custom backend reuse.
- The behavior for cloud and built-in distributions remains defined and tested.

## Backlinks

- Pull request: https://github.com/Comfy-Org/ComfyUI_frontend/pull/16470
- Review comment: https://github.com/Comfy-Org/ComfyUI_frontend/pull/16470#discussion_r3907123018
- Requested by: @christian-byrne

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.