@tracelog/lib 2.0.1 → 2.0.2

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.
@@ -641,7 +641,7 @@ var init_performance_constants = __esm({
641
641
  var version;
642
642
  var init_package = __esm({
643
643
  "package.json"() {
644
- version = "2.0.0";
644
+ version = "2.0.1";
645
645
  }
646
646
  });
647
647
 
@@ -3318,7 +3318,7 @@ var init_event_manager = __esm({
3318
3318
  this.emitEventsQueue(body);
3319
3319
  } else {
3320
3320
  this.clearSendInterval();
3321
- log("warn", "Sync flush failed for all integrations, events remain in queue for next flush", {
3321
+ log("warn", "Sync flush complete failure, events kept in queue for retry", {
3322
3322
  data: { eventCount: eventIds.length }
3323
3323
  });
3324
3324
  }
@@ -3338,21 +3338,9 @@ var init_event_manager = __esm({
3338
3338
  this.removeProcessedEvents(eventIds);
3339
3339
  this.clearSendInterval();
3340
3340
  this.emitEventsQueue(body);
3341
- const failedCount = results.filter((result) => !this.isSuccessfulResult(result)).length;
3342
- if (failedCount > 0) {
3343
- log(
3344
- "warn",
3345
- "Async flush completed with partial success, events removed from queue and persisted per failed integration",
3346
- {
3347
- data: { eventCount: eventsToSend.length, succeededCount: results.length - failedCount, failedCount }
3348
- }
3349
- );
3350
- }
3351
3341
  } else {
3352
- this.removeProcessedEvents(eventIds);
3353
- this.clearSendInterval();
3354
- log("error", "Async flush failed for all integrations, events persisted per-integration for recovery", {
3355
- data: { eventCount: eventsToSend.length, integrations: this.dataSenders.length }
3342
+ log("warn", "Async flush complete failure, events kept in queue for retry", {
3343
+ data: { eventCount: eventsToSend.length }
3356
3344
  });
3357
3345
  }
3358
3346
  return anySucceeded;
@@ -3379,20 +3367,24 @@ var init_event_manager = __esm({
3379
3367
  })
3380
3368
  );
3381
3369
  const results = await Promise.allSettled(sendPromises);
3382
- this.removeProcessedEvents(eventIds);
3383
3370
  const anySucceeded = results.some((result) => this.isSuccessfulResult(result));
3384
3371
  if (anySucceeded) {
3372
+ this.removeProcessedEvents(eventIds);
3385
3373
  this.emitEventsQueue(body);
3374
+ const failedCount = results.filter((result) => !this.isSuccessfulResult(result)).length;
3375
+ if (failedCount > 0) {
3376
+ log("warn", "Periodic send completed with some failures, removed from queue and persisted per-integration", {
3377
+ data: { eventCount: eventsToSend.length, failedCount }
3378
+ });
3379
+ }
3380
+ } else {
3381
+ log("warn", "Periodic send complete failure, events kept in queue for retry", {
3382
+ data: { eventCount: eventsToSend.length }
3383
+ });
3386
3384
  }
3387
3385
  if (this.eventsQueue.length === 0) {
3388
3386
  this.clearSendInterval();
3389
3387
  }
3390
- const failedCount = results.filter((result) => !this.isSuccessfulResult(result)).length;
3391
- if (failedCount > 0) {
3392
- log("warn", "Events send completed with some failures, removed from queue and persisted per-integration", {
3393
- data: { eventCount: eventsToSend.length, failedCount }
3394
- });
3395
- }
3396
3388
  }
3397
3389
  buildEventsPayload() {
3398
3390
  const eventMap = /* @__PURE__ */ new Map();