mirror of
https://github.com/rommapp/romm.git
synced 2026-11-28 17:48:31 +01:00
Removing the read-time recompute left the cached membership blind to everything that is not a ROM edit. A save, a state, a status, or moving a ROM in or out of a regular collection all change what `has_saves`, `has_states`, `statuses`, `collection_id` and `favorite` match, so the stored counts, covers and ROM-detail chips went stale until an unrelated edit or the next scan. Refresh from those paths too: save and state upload, delete and visibility toggle, `update_rom_user` when a status is set, and adding or removing collection members. Sharing an asset is included because `has_saves` matches other users' public saves, so it moves collections that are not the uploader's. These changes leave the ROM row alone, so they pass `membership_only` and only recount a collection when the ROM actually joined or left. Autosaves land constantly, and without it every one of them would force a full recount of any collection the ROM already belonged to. Reported by Greptile on #4039. Implemented with Claude Code (Opus 5), tests first, then reviewed and verified by me. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>