@zaplier/sdk 1.2.2 → 1.2.3

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/sdk.js CHANGED
@@ -6452,8 +6452,11 @@
6452
6452
  return { success: false, method: 'none', error: 'No transports available' };
6453
6453
  }
6454
6454
  let lastError = '';
6455
- // Try each transport in order
6455
+ // Try each transport in order (sequential, not parallel)
6456
6456
  for (const transport of this.transports) {
6457
+ if (this.config.debug) {
6458
+ console.log(`[Zaplier] Trying transport: ${transport.name}`);
6459
+ }
6457
6460
  try {
6458
6461
  const result = await transport.send(data, `${this.baseUrl}${endpoint}`);
6459
6462
  // Update stats
@@ -6461,15 +6464,15 @@
6461
6464
  this.stats.successfulRequests++;
6462
6465
  this.updateMethodStats(transport.name, true);
6463
6466
  if (this.config.debug) {
6464
- console.log(`[Zaplier] Data sent successfully via ${transport.name}`, result);
6467
+ console.log(`[Zaplier] Data sent successfully via ${transport.name} - STOPPING fallback chain`, result);
6465
6468
  }
6466
- return result;
6469
+ return result; // SUCCESS - stop trying other transports
6467
6470
  }
6468
6471
  else {
6469
6472
  this.updateMethodStats(transport.name, false);
6470
6473
  lastError = result.error || 'Unknown error';
6471
6474
  if (this.config.debug) {
6472
- console.warn(`[Zaplier] Transport ${transport.name} failed:`, result.error);
6475
+ console.warn(`[Zaplier] Transport ${transport.name} failed:`, result.error);
6473
6476
  }
6474
6477
  }
6475
6478
  }
@@ -6477,7 +6480,7 @@
6477
6480
  lastError = error instanceof Error ? error.message : String(error);
6478
6481
  this.updateMethodStats(transport.name, false);
6479
6482
  if (this.config.debug) {
6480
- console.warn(`[Zaplier] Transport ${transport.name} threw error:`, error);
6483
+ console.warn(`[Zaplier] Transport ${transport.name} threw error:`, error);
6481
6484
  }
6482
6485
  }
6483
6486
  // Wait before trying next transport