@tangle-network/agent-provider-tangle 5.0.20 → 5.0.21
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/tangle-types.d.ts
CHANGED
|
@@ -225,6 +225,12 @@ export interface SandboxSnapshotInfoLike {
|
|
|
225
225
|
export interface SandboxSnapshotDeleteAcknowledgementLike {
|
|
226
226
|
snapshotId: string;
|
|
227
227
|
outcome: "deleted" | "already_absent" | "unknown";
|
|
228
|
+
/** What the 2xx body itself said; `outcome` folds a missing field and an explicit `unknown`. */
|
|
229
|
+
response?: {
|
|
230
|
+
attestation?: {
|
|
231
|
+
outcome?: "deleted" | "already_absent" | "unknown" | "missing" | "unrecognized";
|
|
232
|
+
};
|
|
233
|
+
};
|
|
228
234
|
}
|
|
229
235
|
/** Result returned by the SDK's durable operation lookup route. */
|
|
230
236
|
export interface SandboxWorkspaceOperationLookupLike {
|
|
@@ -265,11 +265,7 @@ export function createTangleWorkspaceBranching(options) {
|
|
|
265
265
|
operation?.signal?.throwIfAborted();
|
|
266
266
|
return cleanupTransportFailure(request, `Sandbox checkpoint deletion failed: ${safeError(error)}`, true);
|
|
267
267
|
}
|
|
268
|
-
const outcome = result
|
|
269
|
-
result.snapshotId === known.snapshotId &&
|
|
270
|
-
(result.outcome === "deleted" || result.outcome === "already_absent")
|
|
271
|
-
? result.outcome
|
|
272
|
-
: "unknown";
|
|
268
|
+
const outcome = snapshotDeleteOutcome(result, known.snapshotId);
|
|
273
269
|
if (outcome !== "deleted" && outcome !== "already_absent") {
|
|
274
270
|
return cleanupUnknown(request, "Sandbox delete answered unknown (deletion not attested)", true);
|
|
275
271
|
}
|
|
@@ -860,6 +856,22 @@ function forkLookupUnknown(request, message, retryable) {
|
|
|
860
856
|
retryable,
|
|
861
857
|
});
|
|
862
858
|
}
|
|
859
|
+
/**
|
|
860
|
+
* What a Sandbox snapshot delete of a snapshot this handle just listed did. Sandbox answers 200 for
|
|
861
|
+
* "deleted, or already absent" and says which only when its controller can attest it; an explicit
|
|
862
|
+
* `unknown` declines to say which and never means the snapshot remains, since the controller
|
|
863
|
+
* tombstones it and refuses every later restore. The listing is the witness the controller lacked,
|
|
864
|
+
* so the delete removed it. Read as `unknown` on real-work-benchmark-20261129b, such a delete left
|
|
865
|
+
* Runtime naming the removed checkpoint as its restore point, and a reopen's create from it was
|
|
866
|
+
* refused "Snapshot not found". A body that names no outcome stays unknown.
|
|
867
|
+
*/
|
|
868
|
+
function snapshotDeleteOutcome(result, snapshotId) {
|
|
869
|
+
if (!result || result.snapshotId !== snapshotId)
|
|
870
|
+
return "unknown";
|
|
871
|
+
if (result.outcome === "deleted" || result.outcome === "already_absent")
|
|
872
|
+
return result.outcome;
|
|
873
|
+
return result.response?.attestation?.outcome === "unknown" ? "deleted" : "unknown";
|
|
874
|
+
}
|
|
863
875
|
function cleanupDeleted(request) {
|
|
864
876
|
return WorkspaceCleanupAcknowledgementSchema.parse({
|
|
865
877
|
...request,
|