Skip to content

Commit 3a59b2c

Browse files
committed
fixup dbmem
1 parent c85052b commit 3a59b2c

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

coderd/database/dbmem/dbmem.go

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3318,6 +3318,12 @@ func (q *FakeQuerier) GetQuotaAllowanceForUser(_ context.Context, userID uuid.UU
33183318
if member.UserID != userID {
33193319
continue
33203320
}
3321+
if _, err := q.getOrganizationByIDNoLock(member.GroupID); err == nil {
3322+
// This should never happen, but it has been reported in customer deployments.
3323+
// The SQL handles this case, and omits `group_members` rows in the
3324+
// Everyone group. It counts these distinctly via `organization_members` table.
3325+
continue
3326+
}
33213327
for _, group := range q.groups {
33223328
if group.ID == member.GroupID {
33233329
sum += int64(group.QuotaAllowance)

0 commit comments

Comments
 (0)