ComfyUI/tests-unit/assets_test/queries
Luke Mino-Altherr a51bbd0b25 feat: non-destructive asset pruning with is_missing flag
- Add is_missing column to AssetCacheState for soft-delete
- Replace hard-delete pruning with mark_cache_states_missing_outside_prefixes
- Auto-restore missing cache states when files are re-scanned
- Filter out missing cache states from queries by default
- Rename functions for clarity:
  - mark_cache_states_missing_outside_prefixes (was delete_cache_states_outside_prefixes)
  - get_unreferenced_unhashed_asset_ids (was get_orphaned_seed_asset_ids)
  - mark_assets_missing_outside_prefixes (was prune_orphaned_assets)
  - mark_missing_outside_prefixes_safely (was prune_orphans_safely)
- Add restore_cache_states_by_paths for explicit restoration
- Add cleanup_unreferenced_assets for explicit hard-delete when needed
- Update API endpoint /api/assets/prune to use new soft-delete behavior

This preserves user metadata (tags, etc.) when base directories change,
allowing assets to be restored when the original paths become available again.

Amp-Thread-ID: https://ampcode.com/threads/T-019c3114-bf28-73a9-a4d2-85b208fd5462
Co-authored-by: Amp <amp@ampcode.com>
2026-02-24 11:34:44 -08:00
..
conftest.py fix: ruff linting errors and add comprehensive test coverage for asset queries 2026-02-24 11:34:44 -08:00
test_asset_info.py refactor: improve function naming for clarity and consistency 2026-02-24 11:34:44 -08:00
test_asset.py refactor: convert asset tests to table-driven parametrized tests 2026-02-24 11:34:44 -08:00
test_cache_state.py feat: non-destructive asset pruning with is_missing flag 2026-02-24 11:34:44 -08:00
test_metadata.py refactor: convert asset tests to table-driven parametrized tests 2026-02-24 11:34:44 -08:00
test_tags.py refactor: rename functions to verb-based naming convention 2026-02-24 11:34:44 -08:00