Opus finding
loadCrossRepoReceipts may return total counts that disagree with `recent` due to two unsynchronized queries
lowmaintainabilitymedium
- apps/web/lib/outgoing-prs.ts:188-225
Two separate SELECTs against outgoing_prs with no transaction. A pollOutgoingPrs run in between could flip a row to merged, making `value` larger than `recent.length` even when recent.length < limit. Not strictly a correctness bug because total is allowed to exceed recent.length, but the displayed 'N merges upstream' in CrossRepoSection uses rows.length not total — so this is only minor.
Recommendation
Either wrap both queries in a single transaction or compute total from the same fetched set if limit is sufficient.