- Shipped
- August 27, 2026 at 8:16 PM UTC
- Author
- Kamo
- Commit
- dc7af26
SystemBugView is per VIEWER, not per bug — a firstViewedAt column on SystemBug would let whoever opened a report first clear it off every other manager's badge. memberId is a raw Long rather than a @ManyToOne: every query is "for this one member id", and an association would load a Member per row for a question that never looks at one. SystemBugRepository gains two queries: countByStatusUnviewedBy — the nav badge's number. Deliberately two-sided: status alone could only fall when somebody triaged, and read-state alone would leave a bug that is actively being worked still glowing. NOT EXISTS rather than a LEFT JOIN ... IS NULL, so the planner can stop at the first match. countGroupedByStatus — the counts beside each entry of the status filter. Every predicate of findVisible is repeated verbatim except the status one, because the number next to an entry is a promise about what picking it will show. COUNT DISTINCT for the same reason findVisible spells out its count query: the LEFT JOIN to sites yields a row per site a bug names. SystemBugDTO.viewed is about the CALLER, unlike every other field on the record — two members looking at the same report are told different things on purpose. No version bump: the estate stays on one kamo-shared-library version. Needs KamoInitializerService's system_bug_view migration to have run first.