@le-space/ui 0.3.28 → 0.3.30

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@le-space/ui",
3
- "version": "0.3.28",
3
+ "version": "0.3.30",
4
4
  "description": "Floating Aleph sponsor relay UI components for Svelte and React.",
5
5
  "license": "MIT",
6
6
  "type": "module",
@@ -36,8 +36,8 @@
36
36
  "access": "public"
37
37
  },
38
38
  "dependencies": {
39
- "@le-space/browser": "0.3.28",
40
- "@le-space/core": "0.3.28",
39
+ "@le-space/browser": "0.3.30",
40
+ "@le-space/core": "0.3.30",
41
41
  "viem": "^2.38.5"
42
42
  },
43
43
  "peerDependencies": {
package/react/index.js CHANGED
@@ -28,7 +28,7 @@ var RECENT_INSTANCE_RUNTIME_GRACE_MS = 10 * 60 * 1e3;
28
28
  var DEPLOYMENT_PENDING_WARNING_MS = 3 * 60 * 1e3;
29
29
 
30
30
  // src/shared/package-version.ts
31
- var UI_PACKAGE_VERSION = "0.3.28";
31
+ var UI_PACKAGE_VERSION = "0.3.30";
32
32
 
33
33
  // src/shared/format.ts
34
34
  function shortHash(value, head = 8, tail = 6) {
@@ -3483,6 +3483,14 @@ var SponsorRelayController = class {
3483
3483
  crns: this.state.crns,
3484
3484
  crnListUrl: this.props.crnListUrl
3485
3485
  }).catch(() => latestRuntime);
3486
+ this.emitProgress({
3487
+ stage: "deployment-confirmed",
3488
+ label: "Waiting for HTTPS route",
3489
+ progress: 93,
3490
+ status: latestRuntime.webAccess?.active === true ? "info" : "warning",
3491
+ itemHash: args.itemHash,
3492
+ detail: `2n6 activation ${attempt + 1}/${UI_RUNTIME_WAIT_ATTEMPTS}: ${latestRuntime.webAccess?.active === true ? "active" : "still pending"} for ${latestRuntime.proxyUrl ?? runtime.proxyUrl ?? "reserved proxy URL"}.`
3493
+ });
3486
3494
  this.trace("deploy:bootstrap-proxy-activation", {
3487
3495
  itemHash: args.itemHash,
3488
3496
  attempt: attempt + 1,
@@ -3788,6 +3796,7 @@ var SponsorRelayController = class {
3788
3796
  const currentProgress = this.state.deploymentProgress;
3789
3797
  const currentProgressIsForLatestHash = currentProgress.itemHash === itemHash || currentProgress.itemHash == null && currentProgress.stage !== "idle" && currentProgress.stage !== "error";
3790
3798
  const keepTerminalSuccess = this.lastCompletedDeploymentHash === itemHash || currentProgressIsForLatestHash && currentProgress.stage === "completed" && currentProgress.status === "success";
3799
+ const keepSpecificInFlightProgress = currentProgressIsForLatestHash && currentProgress.stage !== "completed" && currentProgress.stage !== "error" && currentProgress.progress >= 93;
3791
3800
  const status = latest.details.messageStatus;
3792
3801
  if (status === "rejected") {
3793
3802
  this.emitProgress({
@@ -3830,6 +3839,16 @@ var SponsorRelayController = class {
3830
3839
  });
3831
3840
  return;
3832
3841
  }
3842
+ if (keepSpecificInFlightProgress) {
3843
+ this.trace("progress:retain-inflight", {
3844
+ reason: "latest refresh would overwrite a more specific in-flight deployment phase",
3845
+ itemHash,
3846
+ currentStage: currentProgress.stage,
3847
+ currentLabel: currentProgress.label,
3848
+ currentProgress: currentProgress.progress
3849
+ });
3850
+ return;
3851
+ }
3833
3852
  this.emitProgress({
3834
3853
  stage: "deployment-confirmed",
3835
3854
  label: "Waiting for runtime",
@@ -3840,6 +3859,16 @@ var SponsorRelayController = class {
3840
3859
  });
3841
3860
  return;
3842
3861
  }
3862
+ if (keepSpecificInFlightProgress) {
3863
+ this.trace("progress:retain-inflight", {
3864
+ reason: "latest refresh would overwrite a more specific in-flight deployment phase",
3865
+ itemHash,
3866
+ currentStage: currentProgress.stage,
3867
+ currentLabel: currentProgress.label,
3868
+ currentProgress: currentProgress.progress
3869
+ });
3870
+ return;
3871
+ }
3843
3872
  this.emitProgress({
3844
3873
  stage: "deployment-confirmed",
3845
3874
  label: "Runtime ready",
@@ -4470,6 +4499,15 @@ var SponsorRelayController = class {
4470
4499
  });
4471
4500
  if (attemptItemHash) {
4472
4501
  if (attemptDeploymentToken) {
4502
+ this.emitProgress({
4503
+ stage: "refreshing-instances",
4504
+ label: "Cleaning up failed attempt",
4505
+ progress: 16,
4506
+ status: "warning",
4507
+ itemHash: attemptItemHash,
4508
+ detail: `Removing bootstrap handoff state for failed deployment on ${attemptLabel}.`,
4509
+ error: lastError.message
4510
+ });
4473
4511
  this.trace("deploy:bootstrap-config-cleanup-start", {
4474
4512
  itemHash: attemptItemHash,
4475
4513
  deploymentToken: attemptDeploymentToken
@@ -4495,8 +4533,26 @@ var SponsorRelayController = class {
4495
4533
  deploymentToken: attemptDeploymentToken,
4496
4534
  error: cleanupError instanceof Error ? cleanupError.message : String(cleanupError)
4497
4535
  });
4536
+ this.emitProgress({
4537
+ stage: "refreshing-instances",
4538
+ label: "Cleanup warning",
4539
+ progress: 16,
4540
+ status: "warning",
4541
+ itemHash: attemptItemHash,
4542
+ detail: `Bootstrap cleanup reported an issue for ${attemptLabel}, but retry cleanup will continue.`,
4543
+ error: cleanupError instanceof Error ? cleanupError.message : String(cleanupError)
4544
+ });
4498
4545
  });
4499
4546
  }
4547
+ this.emitProgress({
4548
+ stage: "refreshing-instances",
4549
+ label: "Discarding failed deployment",
4550
+ progress: 17,
4551
+ status: "warning",
4552
+ itemHash: attemptItemHash,
4553
+ detail: `Forgetting failed deployment ${attemptItemHash.slice(0, 12)} on ${attemptLabel} before retrying.`,
4554
+ error: lastError.message
4555
+ });
4500
4556
  this.trace("deploy:forget-failed-attempt-start", {
4501
4557
  itemHash: attemptItemHash,
4502
4558
  crnHash: candidateCrn.hash,
@@ -4519,12 +4575,30 @@ var SponsorRelayController = class {
4519
4575
  itemHash: attemptItemHash,
4520
4576
  error: cleanupError instanceof Error ? cleanupError.message : String(cleanupError)
4521
4577
  });
4578
+ this.emitProgress({
4579
+ stage: "refreshing-instances",
4580
+ label: "Cleanup warning",
4581
+ progress: 17,
4582
+ status: "warning",
4583
+ itemHash: attemptItemHash,
4584
+ detail: `Failed deployment cleanup reported an issue for ${attemptLabel}.`,
4585
+ error: cleanupError instanceof Error ? cleanupError.message : String(cleanupError)
4586
+ });
4522
4587
  });
4523
4588
  this.trace("deploy:forget-failed-attempt-complete", {
4524
4589
  itemHash: attemptItemHash,
4525
4590
  crnHash: candidateCrn.hash,
4526
4591
  crnName: candidateCrn.name
4527
4592
  });
4593
+ this.emitProgress({
4594
+ stage: "refreshing-instances",
4595
+ label: "Cleanup complete",
4596
+ progress: 18,
4597
+ status: "info",
4598
+ itemHash: attemptItemHash,
4599
+ detail: `Finished cleaning up failed deployment on ${attemptLabel}.`,
4600
+ error: null
4601
+ });
4528
4602
  }
4529
4603
  if (candidateIndex < orderedCrns.length - 1) {
4530
4604
  this.emitProgress({
package/shared/index.d.ts CHANGED
@@ -290,7 +290,7 @@ declare const STALE_INSTANCE_ALLOCATION_COOLDOWN_MS: number;
290
290
  declare const RECENT_INSTANCE_RUNTIME_GRACE_MS: number;
291
291
  declare const DEPLOYMENT_PENDING_WARNING_MS: number;
292
292
 
293
- declare const UI_PACKAGE_VERSION = "0.3.28";
293
+ declare const UI_PACKAGE_VERSION = "0.3.30";
294
294
 
295
295
  interface RootfsRequiredPortForward {
296
296
  port: number;
package/shared/index.js CHANGED
@@ -27,7 +27,7 @@ var RECENT_INSTANCE_RUNTIME_GRACE_MS = 10 * 60 * 1e3;
27
27
  var DEPLOYMENT_PENDING_WARNING_MS = 3 * 60 * 1e3;
28
28
 
29
29
  // src/shared/package-version.ts
30
- var UI_PACKAGE_VERSION = "0.3.28";
30
+ var UI_PACKAGE_VERSION = "0.3.30";
31
31
 
32
32
  // src/shared/format.ts
33
33
  function shortHash(value, head = 8, tail = 6) {
@@ -3482,6 +3482,14 @@ var SponsorRelayController = class {
3482
3482
  crns: this.state.crns,
3483
3483
  crnListUrl: this.props.crnListUrl
3484
3484
  }).catch(() => latestRuntime);
3485
+ this.emitProgress({
3486
+ stage: "deployment-confirmed",
3487
+ label: "Waiting for HTTPS route",
3488
+ progress: 93,
3489
+ status: latestRuntime.webAccess?.active === true ? "info" : "warning",
3490
+ itemHash: args.itemHash,
3491
+ detail: `2n6 activation ${attempt + 1}/${UI_RUNTIME_WAIT_ATTEMPTS}: ${latestRuntime.webAccess?.active === true ? "active" : "still pending"} for ${latestRuntime.proxyUrl ?? runtime.proxyUrl ?? "reserved proxy URL"}.`
3492
+ });
3485
3493
  this.trace("deploy:bootstrap-proxy-activation", {
3486
3494
  itemHash: args.itemHash,
3487
3495
  attempt: attempt + 1,
@@ -3787,6 +3795,7 @@ var SponsorRelayController = class {
3787
3795
  const currentProgress = this.state.deploymentProgress;
3788
3796
  const currentProgressIsForLatestHash = currentProgress.itemHash === itemHash || currentProgress.itemHash == null && currentProgress.stage !== "idle" && currentProgress.stage !== "error";
3789
3797
  const keepTerminalSuccess = this.lastCompletedDeploymentHash === itemHash || currentProgressIsForLatestHash && currentProgress.stage === "completed" && currentProgress.status === "success";
3798
+ const keepSpecificInFlightProgress = currentProgressIsForLatestHash && currentProgress.stage !== "completed" && currentProgress.stage !== "error" && currentProgress.progress >= 93;
3790
3799
  const status = latest.details.messageStatus;
3791
3800
  if (status === "rejected") {
3792
3801
  this.emitProgress({
@@ -3829,6 +3838,16 @@ var SponsorRelayController = class {
3829
3838
  });
3830
3839
  return;
3831
3840
  }
3841
+ if (keepSpecificInFlightProgress) {
3842
+ this.trace("progress:retain-inflight", {
3843
+ reason: "latest refresh would overwrite a more specific in-flight deployment phase",
3844
+ itemHash,
3845
+ currentStage: currentProgress.stage,
3846
+ currentLabel: currentProgress.label,
3847
+ currentProgress: currentProgress.progress
3848
+ });
3849
+ return;
3850
+ }
3832
3851
  this.emitProgress({
3833
3852
  stage: "deployment-confirmed",
3834
3853
  label: "Waiting for runtime",
@@ -3839,6 +3858,16 @@ var SponsorRelayController = class {
3839
3858
  });
3840
3859
  return;
3841
3860
  }
3861
+ if (keepSpecificInFlightProgress) {
3862
+ this.trace("progress:retain-inflight", {
3863
+ reason: "latest refresh would overwrite a more specific in-flight deployment phase",
3864
+ itemHash,
3865
+ currentStage: currentProgress.stage,
3866
+ currentLabel: currentProgress.label,
3867
+ currentProgress: currentProgress.progress
3868
+ });
3869
+ return;
3870
+ }
3842
3871
  this.emitProgress({
3843
3872
  stage: "deployment-confirmed",
3844
3873
  label: "Runtime ready",
@@ -4469,6 +4498,15 @@ var SponsorRelayController = class {
4469
4498
  });
4470
4499
  if (attemptItemHash) {
4471
4500
  if (attemptDeploymentToken) {
4501
+ this.emitProgress({
4502
+ stage: "refreshing-instances",
4503
+ label: "Cleaning up failed attempt",
4504
+ progress: 16,
4505
+ status: "warning",
4506
+ itemHash: attemptItemHash,
4507
+ detail: `Removing bootstrap handoff state for failed deployment on ${attemptLabel}.`,
4508
+ error: lastError.message
4509
+ });
4472
4510
  this.trace("deploy:bootstrap-config-cleanup-start", {
4473
4511
  itemHash: attemptItemHash,
4474
4512
  deploymentToken: attemptDeploymentToken
@@ -4494,8 +4532,26 @@ var SponsorRelayController = class {
4494
4532
  deploymentToken: attemptDeploymentToken,
4495
4533
  error: cleanupError instanceof Error ? cleanupError.message : String(cleanupError)
4496
4534
  });
4535
+ this.emitProgress({
4536
+ stage: "refreshing-instances",
4537
+ label: "Cleanup warning",
4538
+ progress: 16,
4539
+ status: "warning",
4540
+ itemHash: attemptItemHash,
4541
+ detail: `Bootstrap cleanup reported an issue for ${attemptLabel}, but retry cleanup will continue.`,
4542
+ error: cleanupError instanceof Error ? cleanupError.message : String(cleanupError)
4543
+ });
4497
4544
  });
4498
4545
  }
4546
+ this.emitProgress({
4547
+ stage: "refreshing-instances",
4548
+ label: "Discarding failed deployment",
4549
+ progress: 17,
4550
+ status: "warning",
4551
+ itemHash: attemptItemHash,
4552
+ detail: `Forgetting failed deployment ${attemptItemHash.slice(0, 12)} on ${attemptLabel} before retrying.`,
4553
+ error: lastError.message
4554
+ });
4499
4555
  this.trace("deploy:forget-failed-attempt-start", {
4500
4556
  itemHash: attemptItemHash,
4501
4557
  crnHash: candidateCrn.hash,
@@ -4518,12 +4574,30 @@ var SponsorRelayController = class {
4518
4574
  itemHash: attemptItemHash,
4519
4575
  error: cleanupError instanceof Error ? cleanupError.message : String(cleanupError)
4520
4576
  });
4577
+ this.emitProgress({
4578
+ stage: "refreshing-instances",
4579
+ label: "Cleanup warning",
4580
+ progress: 17,
4581
+ status: "warning",
4582
+ itemHash: attemptItemHash,
4583
+ detail: `Failed deployment cleanup reported an issue for ${attemptLabel}.`,
4584
+ error: cleanupError instanceof Error ? cleanupError.message : String(cleanupError)
4585
+ });
4521
4586
  });
4522
4587
  this.trace("deploy:forget-failed-attempt-complete", {
4523
4588
  itemHash: attemptItemHash,
4524
4589
  crnHash: candidateCrn.hash,
4525
4590
  crnName: candidateCrn.name
4526
4591
  });
4592
+ this.emitProgress({
4593
+ stage: "refreshing-instances",
4594
+ label: "Cleanup complete",
4595
+ progress: 18,
4596
+ status: "info",
4597
+ itemHash: attemptItemHash,
4598
+ detail: `Finished cleaning up failed deployment on ${attemptLabel}.`,
4599
+ error: null
4600
+ });
4527
4601
  }
4528
4602
  if (candidateIndex < orderedCrns.length - 1) {
4529
4603
  this.emitProgress({