Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Don't send minidumps that are likely invalid #748

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 10 additions & 2 deletions src/main/integrations/sentry-minidump/minidump-loader.ts
Original file line number Diff line number Diff line change
Expand Up @@ -50,10 +50,18 @@ function createMinidumpLoader(fetchMinidumpsImpl: MinidumpLoader): MinidumpLoade
// remove it from the file system.
knownPaths.push(dump.path);

const stats = await statAsync(dump.path);

// We do not want to upload minidumps that have been generated before a
// certain threshold. Those old files can be deleted immediately.
const stats = await statAsync(dump.path);
if (stats.birthtimeMs < oldestMs) {
const tooOld = stats.birthtimeMs < oldestMs;
const tooSmall = stats.size < 1024;

if (tooSmall) {
logger.log('Minidump too small to be valid', dump.path);
}

if (tooOld || tooSmall) {
await deleteMinidump(dump);
knownPaths.splice(knownPaths.indexOf(dump.path), 1);
return false;
Expand Down
Loading