Skip to content

Commit 99e54ac

Browse files
committed
feat(error-tracking): log how many sourcemaps got a debug_id
Makes it visible in the upload summary log whether debug_id extraction actually found anything, without needing to check the backend table.
1 parent 6654525 commit 99e54ac

1 file changed

Lines changed: 7 additions & 0 deletions

File tree

  • packages/plugins/error-tracking/src/sourcemaps

packages/plugins/error-tracking/src/sourcemaps/sender.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -203,6 +203,7 @@ export const sendSourcemaps = async (
203203
// @ts-expect-error PQueue's default isn't typed.
204204
const Queue = PQueue.default ? PQueue.default : PQueue;
205205
const payloadsQueue = new Queue({ concurrency: options.maxConcurrency });
206+
let debugIdCount = 0;
206207
const payloads: Payload[] = await payloadsQueue.addAll(
207208
sourcemaps.map((sourcemap) => async () => {
208209
// Read the debug_id straight from the minified file's own content instead of
@@ -216,10 +217,16 @@ export const sendSourcemaps = async (
216217
DEBUG_ID_SEARCH_PREFIX_BYTES,
217218
).catch(() => undefined);
218219
const debugId = fileContent ? extractDebugId(fileContent) : undefined;
220+
if (debugId) {
221+
debugIdCount += 1;
222+
}
219223
return getPayload(sourcemap, metadata, prefix, context.git, debugId);
220224
}),
221225
);
222226
payloadsTimer.end();
227+
log.debug(
228+
`Extracted debug_id for ${green(`${debugIdCount}/${sourcemaps.length}`)} sourcemaps.`,
229+
);
223230

224231
const errors = payloads.map((payload) => payload.errors).flat();
225232
const warnings = payloads.map((payload) => payload.warnings).flat();

0 commit comments

Comments
 (0)