From 2224c126723be6bca683241ca582b961676ec001 Mon Sep 17 00:00:00 2001 From: Codex Date: Tue, 29 Sep 2026 23:10:19 +0000 Subject: [PATCH] Retain deletion recovery when native error status is missing Signed-off-by: Codex --- .../communityDeletionPending.test.mjs | 16 ++++++++++++++++ .../communities/communityDeletionPending.ts | 1 + 2 files changed, 17 insertions(+) diff --git a/desktop/src/features/communities/communityDeletionPending.test.mjs b/desktop/src/features/communities/communityDeletionPending.test.mjs index 5041567db4..bf8bac9c63 100644 --- a/desktop/src/features/communities/communityDeletionPending.test.mjs +++ b/desktop/src/features/communities/communityDeletionPending.test.mjs @@ -424,3 +424,19 @@ test("native status, never a body-claimed status, binds acceptance and abort", ( "retain", ); }); + +test("missing native status cannot settle a typed deletion error", () => { + for (const code of ["future_code", "not_owner", "must_archive"]) { + for (const attempt of ["initial", "check"]) { + assert.equal( + deletionResponseDisposition( + { body: { error: { code } } }, + envelope, + attempt, + ), + "retain", + attempt + " " + code + " without native status is ambiguous", + ); + } + } +}); diff --git a/desktop/src/features/communities/communityDeletionPending.ts b/desktop/src/features/communities/communityDeletionPending.ts index f4c1cc3a57..09feb46786 100644 --- a/desktop/src/features/communities/communityDeletionPending.ts +++ b/desktop/src/features/communities/communityDeletionPending.ts @@ -239,6 +239,7 @@ export function deletionResponseDisposition( ].some((field) => Object.hasOwn(response, field)); if ( code && + typeof status === "number" && (!suppliedTuple || tupleMatches) && DEFINITIVE_ERRORS[code] === status && (attempt === "initial" || !FRESH_ONLY_ERRORS.has(code))