fix(release): isolate checkpoint journal failures

This commit is contained in:
Vincent Koc
2026-08-21 12:13:34 -07:00
parent 16f6839fb6
commit bb243bcffd
3 changed files with 173 additions and 20 deletions
@@ -45,21 +45,16 @@ function encodeBase64url(bytes) {
}
function decodeBase64url(value, label) {
if (typeof value !== "string" || !/^[A-Za-z0-9_-]+$/u.test(value)) {
if (typeof value !== "string" || !/^[A-Za-z0-9_-]+$/u.test(value))
throw new Error(`${label} is not canonical base64url`);
}
const decoded = Buffer.from(value, "base64url");
if (encodeBase64url(decoded) !== value) {
throw new Error(`${label} is not canonical base64url`);
}
if (encodeBase64url(decoded) !== value) throw new Error(`${label} is not canonical base64url`);
return decoded;
}
function normalizeKind(value) {
const kind = requiredString(value, "checkpoint kind");
if (!CHECKPOINT_KINDS.has(kind)) {
throw new Error(`checkpoint kind is invalid: ${kind}`);
}
if (!CHECKPOINT_KINDS.has(kind)) throw new Error(`checkpoint kind is invalid: ${kind}`);
return kind;
}