@applitools/core-base
Advanced tools
@@ -606,9 +606,8 @@ "use strict"; | ||
| async function logEventBatch(batch) { | ||
| // Seed the reduce with `mainLogger` and skip undefined loggers: callers may omit the logger | ||
| // (the public `logEvent` contract types it optional — e.g. the SDK.deprecation event), so an | ||
| // unseeded/unguarded reduce here threw on an undefined accumulator and killed the process. | ||
| const logger = batch | ||
| .map(([{ logger }]) => logger) | ||
| .reduce((acc, logger) => (logger ? acc.extend(logger) : acc), mainLogger) | ||
| .extend({ tags: [`core-request-${utils.general.shortid()}`] }); | ||
| // Built from the events' own loggers only: seeding with `mainLogger` would leak its console | ||
| // handler into batch logs; the filter also guards the logger-less case (unseeded reduce crash). | ||
| const loggers = batch.map(([{ logger }]) => logger).filter((logger) => Boolean(logger)); | ||
| const logger = (loggers.length > 0 ? loggers.reduce((acc, logger) => acc.extend(logger)) : mainLogger).extend({ | ||
| tags: [`core-request-${utils.general.shortid()}`], | ||
| }); | ||
| const req = (0, req_eyes_1.makeReqEyes)({ settings: batch[0][0].settings, fetch, logger }); | ||
@@ -615,0 +614,0 @@ logger.log('Request "logEventBatch" called with settings', batch); |
+1
-1
| { | ||
| "name": "@applitools/core-base", | ||
| "version": "1.36.2", | ||
| "version": "1.37.0", | ||
| "homepage": "https://applitools.com", | ||
@@ -5,0 +5,0 @@ "bugs": { |
+3
-1
@@ -510,2 +510,3 @@ import type { MaybeArray, Region, Size, Location } from '@applitools/utils'; | ||
| readonly renderId: string[]; | ||
| readonly isAutoAcceptedInfraUpdate?: boolean; | ||
| }; | ||
@@ -569,4 +570,5 @@ type ApiUrls = { | ||
| readonly reason?: unknown; | ||
| readonly isAutoAcceptedInfraUpdate?: boolean; | ||
| readonly hasAutoAcceptedInfraUpdateSteps?: boolean; | ||
| readonly allMismatchesAreInfra?: boolean; | ||
| } | ||
| export {}; |
Sorry, the diff of this file is too big to display
281106
0.25%4317
0.02%