fix(reference): preserve physical failures across late cancellation (#10072)

* fix(reference): preserve physical failures across late cancellation

* fix(reference): retain late cancellation alongside read failures

* fix(reference): preserve metadata errors through cancellation

* fix(reference): retain directory failure identity

* fix(reference): preserve parallel physical and cancellation outcomes

* fix(reference): preserve optional Git metadata absence
This commit is contained in:
morluto authored and GitHub committed 2026-11-11 18:53:08 +08:00
1 parent 3ad2e214be
commit 0e0af455f2
13 files changed
+781 -199

No files matched your search

@@ -45,6 +45,12 @@ export const validateDirectory = async (
readonly localDiagnostic?: string;
}
> => {
if (isAborted(signal))
return {
ok: false,
code: "cancelled",
message: "Reference source traversal cancelled",
};
try {
const rootNow = await bigLstat(root);
if (!sameFile(rootIdentity, rootNow))
@@ -71,12 +77,6 @@ export const validateDirectory = async (
};
return { ok: true, stats };
} catch (cause: unknown) {
if (isAborted(signal))
return {
ok: false,
code: "cancelled",
message: "Reference source traversal cancelled",
};
const detail = filesystemFailureDetail(
cause,
"Directory identity could not be verified",
@@ -121,7 +121,6 @@ export const prepareRoot = async (
);
return ok({ canonicalRoot, rootIdentity: canonicalMetadata });
} catch (cause: unknown) {
if (isAborted(signal)) return err(cancelled(signal));
const rootFailure = rootFilesystemFailure(
cause,
"Reference source root could not be resolved",