@tangle-network/agent-provider-tangle 3.6.8 → 3.6.10
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-provider.js +11 -5
- package/package.json +1 -1
package/dist/tangle-provider.js
CHANGED
|
@@ -306,10 +306,12 @@ export function createTangleProvider(options) {
|
|
|
306
306
|
if (!box || boundedIdentifier(box.id, "Tangle environment id") !== id)
|
|
307
307
|
return null;
|
|
308
308
|
if (options.requireNativeSessionCapture) {
|
|
309
|
-
requireNativeCaptureProof(box);
|
|
310
309
|
// Native capture admits only the backend the live container reports, so a
|
|
311
|
-
// suspended sandbox must run again before anything can reconnect to it.
|
|
310
|
+
// suspended sandbox must run again before anything can reconnect to it. A stopped
|
|
311
|
+
// sandbox has no container and so no capture proof; the proof is required of the
|
|
312
|
+
// container the resume produced.
|
|
312
313
|
await resumeForReconnect(box, options.client, readyTimeoutMs, operation?.signal);
|
|
314
|
+
requireNativeCaptureProof(box);
|
|
313
315
|
}
|
|
314
316
|
let backendType;
|
|
315
317
|
let backendReadError;
|
|
@@ -416,7 +418,7 @@ export function createTangleProvider(options) {
|
|
|
416
418
|
};
|
|
417
419
|
}
|
|
418
420
|
/**
|
|
419
|
-
*
|
|
421
|
+
* Wait for a usable sandbox before a reconnect reads its container.
|
|
420
422
|
*
|
|
421
423
|
* The platform suspends a sandbox after its idle timeout (30 minutes by
|
|
422
424
|
* default) and nothing resumes it on access. A root turn stalled on an
|
|
@@ -425,10 +427,14 @@ export function createTangleProvider(options) {
|
|
|
425
427
|
* the driver exhausts its attempts. After the resume the sidecar reports the
|
|
426
428
|
* interrupted execution as a terminal failure, so the caller settles that
|
|
427
429
|
* execution and replaces it once instead of dispatching beside it.
|
|
430
|
+
* A box can also report running while its replacement filesystem incarnation
|
|
431
|
+
* is still becoming ready. The same SDK wait closes that gap before backend
|
|
432
|
+
* status is read.
|
|
428
433
|
*/
|
|
429
434
|
async function resumeForReconnect(box, client, timeoutMs, signal) {
|
|
430
|
-
|
|
431
|
-
|
|
435
|
+
// A running lifecycle status can precede the filesystem incarnation and
|
|
436
|
+
// selected backend becoming readable after a container restart. The SDK's
|
|
437
|
+
// waitFor("running") also waits for that incarnation to be ready.
|
|
432
438
|
if (box.status === "stopped") {
|
|
433
439
|
if (!box.resume) {
|
|
434
440
|
throw new Error(`Tangle sandbox ${box.id} is stopped and the linked client cannot resume it`);
|