diff --git a/src/client/ClanTagInput.ts b/src/client/ClanTagInput.ts index 5200f875d..1ac2cad97 100644 --- a/src/client/ClanTagInput.ts +++ b/src/client/ClanTagInput.ts @@ -131,10 +131,11 @@ export class ClanTagInput extends LitElement { this.checkCounter++; if (!result.isValid || tag.length === 0) { - // Nothing to ask the server about — clear any old ownership error, - // and remember the cleared/short value across reloads. + // Nothing to ask the server about — clear any old ownership error + // and wipe the stored tag so a reload doesn't restore a stale value + // that no longer matches the current (invalid/empty) input. this.ownershipError = ""; - if (result.isValid) localStorage.setItem(clanTagKey, ""); + localStorage.setItem(clanTagKey, ""); } else { this.checkTimer = setTimeout(() => { this.checkTimer = null; diff --git a/src/server/Worker.ts b/src/server/Worker.ts index b81067f5a..d433aef47 100644 --- a/src/server/Worker.ts +++ b/src/server/Worker.ts @@ -473,12 +473,14 @@ export async function startWorker() { : [], ); if (!userClanTags.has(resolvedClanTag.toUpperCase())) { + // Fail closed: inconclusive (null) means drop, not keep. const exists = await clanExistsByTag(resolvedClanTag); - if (exists === true) { + if (exists !== false) { log.warn("Dropped clan tag: player is not a member", { persistentID: persistentId, gameID: clientMsg.gameID, clanTag: resolvedClanTag, + existsResult: exists, }); resolvedClanTag = null; }