mirror of
https://github.com/block/buzz.git
synced 2026-11-07 18:01:06 +00:00
Retain deletion recovery when native error status is missing
Signed-off-by: Codex <noreply@openai.com>
This commit is contained in:
@@ -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",
|
||||
);
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
@@ -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))
|
||||
|
||||
Reference in New Issue
Block a user