Files
romm/backend/handler/database
Georges-Antoine Assi c69e77ba0a fix(backend): load platform_id on siblings to avoid DetachedInstanceError
The single-rom endpoints (`/{id}/simple`, `/{id}`) build SiblingRomSchema
from the eager-loaded `sibling_roms` relationship. `_visible_siblings`
filters those siblings with `perms.can_see_rom(s.id, s.platform_id)`, but
the `with_details` loader restricts sibling columns via `load_only` and did
not include `platform_id`. Reading the deferred attribute after the session
closed triggered a lazy load on a detached instance, raising
DetachedInstanceError.

Add `Rom.platform_id` to the sibling `load_only` so the permission check
reads an already-loaded column.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-29 18:10:03 -04:00
..
2025-09-04 11:17:00 -03:00
2026-03-12 23:02:12 -04:00
2026-04-06 22:29:55 -04:00