Discord: self-serve server→org linking with /drb link (#213 item 1) #218
@@ -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 && (
|
||||||
|
|||||||
Reference in New Issue
Block a user