fix(discord): non-owners no longer see a stuck "Loading…" on the servers card (#213)

The card only loads for owners/admins (the list endpoint is owner-only), so a
member saw "Loading…" forever. Show an owner-only note instead. Also assert the
one-server/two-org race really retried, as the PR body already claimed.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Logan Cusano
2026-10-04 20:11:27 -04:00
co-authored by Claude Opus 5.5
parent 455c55f5c2
commit e86507cd2d
2 changed files with 5 additions and 1 deletions
@@ -147,6 +147,7 @@ async def test_one_server_racing_two_orgs_codes_ends_on_exactly_one(fs):
b = await _mint(OWNER_B) b = await _mint(OWNER_B)
_hold_both_at_commit(fs) _hold_both_at_commit(fs)
r1, r2 = await asyncio.gather(_redeem(a["code"], user="u1"), _redeem(b["code"], user="u2")) r1, r2 = await asyncio.gather(_redeem(a["code"], user="u1"), _redeem(b["code"], user="u2"))
assert fs.retries >= 1 # the race really happened
assert sorted([_status(r1), _status(r2)]) == [200, 409] assert sorted([_status(r1), _status(r2)]) == [200, 409]
winner = "org-a" if _status(r1) == 200 else "org-b" winner = "org-a" if _status(r1) == 200 else "org-b"
loser_code = b["code"] if winner == "org-a" else a["code"] loser_code = b["code"] if winner == "org-a" else a["code"]
@@ -171,7 +171,10 @@ export function DiscordServersCard({ canEdit, isAdmin }: { canEdit: boolean; isA
</tr> </tr>
</thead> </thead>
<tbody> <tbody>
{guilds === null && !loadError && ( {!canEdit && (
<tr><td colSpan={4} className="px-5 py-4 text-xs text-ink-muted">Only the organization owner can see and link Discord servers.</td></tr>
)}
{canEdit && guilds === null && !loadError && (
<tr><td colSpan={4} className="px-5 py-4 text-xs text-ink-muted">Loading…</td></tr> <tr><td colSpan={4} className="px-5 py-4 text-xs text-ink-muted">Loading…</td></tr>
)} )}
{loadError && ( {loadError && (