allow absent base during addressed recovery
This commit is contained in:
@@ -439,9 +439,8 @@ export class WorkspaceRegistry {
|
|||||||
if (state.phase === "publication_intent_durable") {
|
if (state.phase === "publication_intent_durable") {
|
||||||
const activeBefore = await this.#tryActiveState();
|
const activeBefore = await this.#tryActiveState();
|
||||||
const activeDigest = activeBefore ? registryDigest(activeBefore) : undefined;
|
const activeDigest = activeBefore ? registryDigest(activeBefore) : undefined;
|
||||||
const baseAllowed = operation === "registry_bootstrap"
|
const baseAllowed = activeBefore === undefined
|
||||||
? activeBefore === undefined
|
|| (operation === "registry_pull" && activeBefore.head === state.baseCommit && activeDigest === state.baseManifestSha256);
|
||||||
: (activeBefore !== undefined && activeBefore.head === state.baseCommit && activeDigest === state.baseManifestSha256);
|
|
||||||
const targetAllowed = activeBefore !== undefined && activeBefore.head === target && activeDigest === state.targetManifestSha256;
|
const targetAllowed = activeBefore !== undefined && activeBefore.head === target && activeDigest === state.targetManifestSha256;
|
||||||
if (!baseAllowed && !targetAllowed) throw new WorkspaceRegistryError("registry_bootstrap_recovery_conflict", "Active registry identity conflicts with addressed publication");
|
if (!baseAllowed && !targetAllowed) throw new WorkspaceRegistryError("registry_bootstrap_recovery_conflict", "Active registry identity conflicts with addressed publication");
|
||||||
if (targetAllowed) publication = operation === "registry_pull" && state.baseCommit === target ? "unchanged" : "reconciled_target";
|
if (targetAllowed) publication = operation === "registry_pull" && state.baseCommit === target ? "unchanged" : "reconciled_target";
|
||||||
|
|||||||
Reference in New Issue
Block a user