Comfy-Org / Comfy-Org/ComfyUI_frontend

Add flag-ON unified cloud auth account-switch E2E coverage

Open
#13,969 1 comment 1 reaction 1 assignee Claimed by @christian-byrne View on GitHub
area:auth area:testing
Dominant language
TypeScript
Stars
2k
Forks
699
Avg merge
1d 7h
Merged PRs (30d)
490

Description

## Summary
Add a Playwright browser end-to-end regression for direct Firebase account switching with `unified_cloud_auth` enabled.

The existing account-switch E2E intentionally sets `unified_cloud_auth: false` to cover the active flag-OFF team-workspace incident path. Unified authentication currently ships at 0%, so this follow-up must land before the flag is enabled.

## Rationale
The unified path contains the newest account-isolation and recovery logic, but it is currently covered primarily by mocked unit tests. A browser-level regression is needed to validate that a direct switch from account A to account B cannot reuse account A credentials or allow stale auth responses to overwrite account B state.

## Affected areas
- `browser_tests/tests/authAccountSwitch.spec.ts`
- Unified workspace authentication in `src/platform/workspace/stores/workspaceAuthStore.ts`
- Unified remint/retry flows in `src/platform/auth/unified/remintRetry.ts`
- Session/token rotation coordination as applicable

## Required work
- Add a flag-ON browser scenario, while retaining the existing flag-OFF regression.
- Exercise switching from one Firebase account to another and verify the active unified workspace credential belongs to account B.
- Validate that stale account-A mint/remint or retry results cannot overwrite account-B state.
- Cover a protected request or equivalent flow that confirms the switched account’s bearer/session context is used.
- Where practical, exercise the unified reactive-401 remint/replay path and token-refresh rotation behavior.

## Acceptance criteria
- A Playwright E2E test runs with `unified_cloud_auth: true`.
- After direct account switching, protected unified-auth requests succeed only with account B credentials.
- The test demonstrates that account A credentials and stale asynchronous responses cannot be used after the switch.
- The existing flag-OFF account-switch E2E remains covered and passing.
- The new test is included in the relevant Cloud/browser test suite before unified auth rollout is enabled.

## Context
Requested by @christian-byrne.

- PR: https://github.com/Comfy-Org/ComfyUI_frontend/pull/13832
- Review discussion: https://github.com/Comfy-Org/ComfyUI_frontend/pull/13832#discussion_r3626045895

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.