Keep checked browser runtime versions independent of authority upgrades

This commit is contained in:
Timothy J. Aveni
2026-10-07 17:03:01 -07:00
parent 391f02f78a
commit 61534d3fb5
3 changed files with 24 additions and 7 deletions
+3 -3
View File
@@ -104,7 +104,7 @@ export async function readCandidateMetadata(
path: string,
scope: CandidateMetadataScope,
limit: number,
): Promise<{ bytes: Uint8Array; releaseInput: () => void }> {
): Promise<{ bytes: Uint8Array; releaseInput: () => void; releaseTree: () => void }> {
const handle = await open(path, constants.O_RDONLY | constants.O_NOFOLLOW | constants.O_NONBLOCK);
let releaseInput: (() => void) | undefined;
try {
@@ -123,8 +123,8 @@ export async function readCandidateMetadata(
if (offset !== stat.size) throw Error("CANDIDATE_METADATA_CHANGED");
const content = bytes.subarray(0, offset);
// No JSON.parse/decoded tree exists until its shape-based charge succeeds.
scope.charge(jsonAllocation(content));
return { bytes: content, releaseInput };
const releaseTree = scope.reserve(jsonAllocation(content));
return { bytes: content, releaseInput, releaseTree };
} catch (error) {
releaseInput?.();
throw error;