mirror of
https://github.com/Comfy-Org/ComfyUI_frontend.git
synced 2026-07-11 09:42:22 +00:00
## Summary Fix Cloud missing-media false positives for output videos inserted as loader nodes when the widget value includes a subfoldered output path such as `video/<hash>.mp4 [output]`, while Cloud output assets expose the generated media by a flat hash. ## Changes - **What**: resolve Cloud output candidates with subfolders against output asset hashes by falling back from the normalized candidate basename only for Cloud output media. - **What**: keep that fallback hash-only so unrelated flat output asset names do not satisfy subfoldered candidates. - **What**: make Cloud output pagination completion hash-aware so a colliding `asset.name` does not stop loading before the hash match appears. - **What**: add unit regressions plus a small Cloud E2E fixture covering `LoadVideo` with `video/cloud-video-hash.mp4 [output]`. - No breaking changes or dependency changes. ## Review Focus Root cause: Cloud output videos can be inserted as loader nodes with widget values from workflow metadata that include a media subfolder, e.g. `video/<hash>.mp4 [output]`. The Cloud output asset list resolves generated media by a flat hash. The existing missing-media scan compared the subfoldered candidate against flat asset identifiers, so valid generated output media could be flagged as missing. Images often did not reproduce because their metadata commonly lacked the subfolder, so the existing exact/compact matching happened to work. Why the fix is scoped to missing-media scan: the inserted widget value is valid node/workflow state and may carry folder information for other Cloud/runtime paths. Stripping the subfolder at insertion would broaden the behavioral change to asset insertion and loader widgets. Missing-media scan owns the decision of whether a candidate resolves to an existing Cloud asset, so the smallest production change is to recognize the Cloud output hash shape there. Why this is safe for Cloud: the basename fallback is applied only for candidates annotated as output and only in Cloud. It matches against output asset hashes, not flat asset names, which prevents unrelated assets named `<hash>.mp4` from masking a real miss. Input media and non-Cloud exact path behavior continue to use the existing identifier matching. Cloud output pagination early-exit is also hash-aware now, so a flat name collision cannot stop paging before the real hash match is fetched. Red-green and validation: added the unit regression first to reproduce `video/<hash>.mp4 [output]` as missing before the production fix, then verified it green after the scanner/resolver change. Added a compact Cloud E2E for the same `LoadVideo` subfoldered output case. Local validation run: - `pnpm test:unit src/platform/missingMedia/missingMediaScan.test.ts src/platform/missingMedia/missingMediaAssetResolver.test.ts` - 59 passed - `PLAYWRIGHT_LOCAL=1 PLAYWRIGHT_TEST_URL=http://localhost:5175 PLAYWRIGHT_SETUP_API_URL=http://localhost:8188 pnpm exec playwright test browser_tests/tests/propertiesPanel/errorsTabMissingMediaRuntime.spec.ts --project=cloud --grep "subfoldered output video" --repeat-each=5 --reporter=line` - 5 passed - `PLAYWRIGHT_LOCAL=1 PLAYWRIGHT_TEST_URL=http://localhost:5175 PLAYWRIGHT_SETUP_API_URL=http://localhost:8188 pnpm exec playwright test browser_tests/tests/propertiesPanel/errorsTabMissingMediaRuntime.spec.ts --project=cloud --grep "resolves compact annotated output media|resolves subfoldered output video" --reporter=line` - 2 passed - `pnpm typecheck` - `pnpm typecheck:browser` - `pnpm knip` - `pnpm lint` - staged pre-commit hooks: oxfmt, oxlint, eslint, typecheck, typecheck:browser ## Screenshots (if applicable) Before https://github.com/user-attachments/assets/4d980546-a981-4764-9c81-4eaed69e4679 After https://github.com/user-attachments/assets/6a4ddb26-6c16-4cbf-b7bc-b9cd55eece58