@sparkvault/sdk 1.23.7 → 1.23.9

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.
@@ -639,7 +639,10 @@ class IdentityApi {
639
639
  constructor(config, timeoutMs = DEFAULT_TIMEOUT_MS$1) {
640
640
  /** Cached config promise - allows preloading and deduplication */
641
641
  this.configCache = null;
642
- /** Abort controller for cancelling all pending requests on close */
642
+ /**
643
+ * Abort controller for cancelling all pending requests on close.
644
+ * Replaced by resetSession() at the start of every user-facing session.
645
+ */
643
646
  this.closeController = new AbortController();
644
647
  this.config = config;
645
648
  this.timeoutMs = timeoutMs;
@@ -657,6 +660,16 @@ class IdentityApi {
657
660
  isAborted() {
658
661
  return this.closeController.signal.aborted;
659
662
  }
663
+ /**
664
+ * Reset the session lifecycle by swapping in a fresh AbortController.
665
+ * The Module calls this at the start of every user-facing session so a
666
+ * previously-closed session can never leak its aborted state into the
667
+ * next one. The config cache is intentionally preserved across sessions
668
+ * so preloadConfig() keeps making modal opens instant.
669
+ */
670
+ resetSession() {
671
+ this.closeController = new AbortController();
672
+ }
660
673
  get baseUrl() {
661
674
  return `${this.config.identityBaseUrl}/${this.config.accountId}`;
662
675
  }
@@ -6306,6 +6319,10 @@ class IdentityModule {
6306
6319
  if (this.renderer) {
6307
6320
  this.renderer.close();
6308
6321
  }
6322
+ // Reset session lifecycle before every modal open. Without this, the
6323
+ // AbortController aborted on close() would short-circuit the next
6324
+ // session's first request as "Request cancelled".
6325
+ this.api.resetSession();
6309
6326
  const isInline = !!options.target;
6310
6327
  const container = isInline
6311
6328
  ? this.createInlineContainer(options.target)
@@ -6545,7 +6562,10 @@ function isInitiateUploadResponse(data) {
6545
6562
  }
6546
6563
  class UploadApi {
6547
6564
  constructor(config) {
6548
- /** Abort controller for cancelling all pending requests on close */
6565
+ /**
6566
+ * Abort controller for cancelling all pending requests on close.
6567
+ * Replaced by resetSession() at the start of every user-facing session.
6568
+ */
6549
6569
  this.closeController = new AbortController();
6550
6570
  this.config = config;
6551
6571
  this.timeoutMs = config.timeout ?? DEFAULT_TIMEOUT_MS;
@@ -6569,6 +6589,15 @@ class UploadApi {
6569
6589
  getAbortSignal() {
6570
6590
  return this.closeController.signal;
6571
6591
  }
6592
+ /**
6593
+ * Reset the session lifecycle by swapping in a fresh AbortController.
6594
+ * The Module calls this at the start of every user-facing session so a
6595
+ * previously-closed session can never leak its aborted state into the
6596
+ * next one. (Long-lived caches on `this` are intentionally preserved.)
6597
+ */
6598
+ resetSession() {
6599
+ this.closeController = new AbortController();
6600
+ }
6572
6601
  /**
6573
6602
  * Get vault upload info (public endpoint).
6574
6603
  */
@@ -9405,6 +9434,10 @@ class VaultUploadModule {
9405
9434
  ...options,
9406
9435
  backdropBlur: options.backdropBlur ?? this.config.backdropBlur,
9407
9436
  };
9437
+ // Reset session lifecycle before every modal open. Without this, the
9438
+ // AbortController aborted on close() would short-circuit the next
9439
+ // session's first request as "Request cancelled".
9440
+ this.api.resetSession();
9408
9441
  return new Promise((resolve, reject) => {
9409
9442
  this.renderer = new UploadRenderer(container, this.api, mergedOptions, {
9410
9443
  onSuccess: (result) => {