From e86507cd2d77eaae7897a5d4290d9e92443850fd Mon Sep 17 00:00:00 2001 From: Logan Cusano Date: Sun, 4 Oct 2026 20:11:27 -0400 Subject: [PATCH] =?UTF-8?q?fix(discord):=20non-owners=20no=20longer=20see?= =?UTF-8?q?=20a=20stuck=20"Loading=E2=80=A6"=20on=20the=20servers=20card?= =?UTF-8?q?=20(#213)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 --- drb-c2-core/tests/test_discord_guild_link.py | 1 + drb-frontend/components/DiscordServersCard.tsx | 5 ++++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/drb-c2-core/tests/test_discord_guild_link.py b/drb-c2-core/tests/test_discord_guild_link.py index 536372f..16bf322 100644 --- a/drb-c2-core/tests/test_discord_guild_link.py +++ b/drb-c2-core/tests/test_discord_guild_link.py @@ -147,6 +147,7 @@ async def test_one_server_racing_two_orgs_codes_ends_on_exactly_one(fs): b = await _mint(OWNER_B) _hold_both_at_commit(fs) 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] winner = "org-a" if _status(r1) == 200 else "org-b" loser_code = b["code"] if winner == "org-a" else a["code"] diff --git a/drb-frontend/components/DiscordServersCard.tsx b/drb-frontend/components/DiscordServersCard.tsx index b51f664..56606a8 100644 --- a/drb-frontend/components/DiscordServersCard.tsx +++ b/drb-frontend/components/DiscordServersCard.tsx @@ -171,7 +171,10 @@ export function DiscordServersCard({ canEdit, isAdmin }: { canEdit: boolean; isA - {guilds === null && !loadError && ( + {!canEdit && ( + Only the organization owner can see and link Discord servers. + )} + {canEdit && guilds === null && !loadError && ( Loading… )} {loadError && (