mirror of
https://github.com/Comfy-Org/ComfyUI.git
synced 2026-08-30 12:56:08 +08:00
`Asset.updated_at` carried `onupdate=get_utc_now`, so every write to the row moved it — including writes the user never asked for. Serving a download or a hash bumped it via `update_record_access_time`, and background enrichment bumped it by assigning `system_metadata`/`mime_type`. Sorting the catalog by `updated_at` therefore reordered on reads and on scanner passes. Master never did this; the coupling is this branch's regression. `onupdate` is gone and each explicit user/API mutation sets the column itself: the `user_metadata`, `mime_type` and `preview_id` updates fold it into their existing `.values()`, `rename_record` already did it, and manual tag writes now bump it through `bump_record_updated_at` — once per call, and only when a link was actually added or removed, so a no-op tag call stays inert. Deliberately not full master parity: master's background fills also bumped `updated_at`, and keeping that would let a future hashing-enabled enrichment sweep silently reorder the whole catalog. Access-time bookkeeping, enrichment, the automatic missing/recovered tag projection, content split/retire, and the preview-target `SET NULL` cascade all leave the column alone. `apply_tags`/`remove_tags` take no new parameter: their only production callers are the two user-facing tag routes, so the bump is unconditional at the point a link changes and no system caller can reach it.