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