Comfy-Org / Comfy-Org/ComfyUI_frontend
Define retention policy for test-recorder storage-state files
- Dominant language
- TypeScript
- Stars
- 2k
- Forks
- 699
- Avg merge
- 1d 7h
- Merged PRs (30d)
- 490
Description
## Summary
Define and implement a deliberate retention policy for test-recorder browser storage-state files.
PR #16470 isolates custom backend storage-state files by backend URL. This prevents cookie reuse across unrelated custom backends. The recorder can now retain one credential-bearing file for each backend. A follow-up must decide how and when to remove stale files without disrupting active recording sessions.
## Required changes
- Define the retention policy for files in `~/.comfy-test`, including the age limit or LRU cap and the cleanup trigger.
- Implement safe pruning for `storage-state.*.json` files used by `tools/test-recorder`.
- Preserve the active storage-state file during cleanup.
- Handle missing files, permission errors, locks, and malformed metadata without aborting recording.
- Define the migration behavior for the legacy `storage-state.custom.json` file.
- Add focused tests for policy behavior and failure handling.
- Document the retention behavior for test-recorder users.
## Rationale
Storage-state files contain live session cookies. Per-backend storage-state isolation is safer than the previous shared custom file, but stale files can accumulate over time. A retention policy requires explicit security, usability, and migration decisions.
## Affected areas
- `tools/test-recorder/src/recorder/template.ts`
- `tools/test-recorder/src/recorder/runner.ts`
- Test-recorder storage-state tests and user documentation
## Acceptance criteria
- The recorder prunes stale storage-state files according to a documented policy.
- Cleanup does not delete the storage-state file selected for the current recording.
- Cleanup failures do not prevent a recording session from starting.
- Tests cover stale-file deletion, preservation of active files, legacy-file handling, and filesystem errors.
## Backlinks
- Pull request: https://github.com/Comfy-Org/ComfyUI_frontend/pull/16470
- Review discussion: https://github.com/Comfy-Org/ComfyUI_frontend/pull/16470#discussion_r3907123050
- Requested by: @christian-byrne
Contributor guide
Assessment
This issue has not been assessed yet.