-
-
Notifications
You must be signed in to change notification settings - Fork 58
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
160 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,84 @@ | ||
{ | ||
"method": "envelope", | ||
"sentryKey": "37f8a2ee37c0409d8970bc7559c7c7e4", | ||
"appId": "277345", | ||
"data": { | ||
"sdk": { | ||
"name": "sentry.javascript.electron", | ||
"packages": [ | ||
{ | ||
"name": "npm:@sentry/electron", | ||
"version": "{{version}}" | ||
} | ||
], | ||
"version": "{{version}}" | ||
}, | ||
"contexts": { | ||
"app": { | ||
"app_name": "native-sentry-unknown", | ||
"app_version": "1.0.0", | ||
"app_start_time": "{{time}}" | ||
}, | ||
"browser": { | ||
"name": "Chrome" | ||
}, | ||
"chrome": { | ||
"name": "Chrome", | ||
"type": "runtime", | ||
"version": "{{version}}" | ||
}, | ||
"device": { | ||
"arch": "{{arch}}", | ||
"family": "Desktop", | ||
"memory_size": 0, | ||
"free_memory": 0, | ||
"processor_count": 0, | ||
"processor_frequency": 0, | ||
"cpu_description": "{{cpu}}", | ||
"screen_resolution": "{{screen}}", | ||
"screen_density": 1 | ||
}, | ||
"culture": { | ||
"locale": "{{locale}}", | ||
"timezone": "{{timezone}}" | ||
}, | ||
"node": { | ||
"name": "Node", | ||
"type": "runtime", | ||
"version": "{{version}}" | ||
}, | ||
"os": { | ||
"name": "{{platform}}", | ||
"version": "{{version}}" | ||
}, | ||
"runtime": { | ||
"name": "Electron", | ||
"version": "{{version}}" | ||
} | ||
}, | ||
"release": "[email protected]", | ||
"environment": "development", | ||
"event_id": "{{id}}", | ||
"timestamp": 0, | ||
"breadcrumbs": [ | ||
{ | ||
"category": "console", | ||
"level": "log", | ||
"message": "main process breadcrumb from second run" | ||
} | ||
], | ||
"tags": { | ||
"event.environment": "native", | ||
"event.origin": "electron", | ||
"event.process": "unknown", | ||
"app-run": "second" | ||
} | ||
}, | ||
"attachments": [ | ||
{ | ||
"length": 12004, | ||
"filename": "0dc9e285-df8d-47b7-8147-85308b54065a.dmp", | ||
"attachment_type": "event.minidump" | ||
} | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
{ | ||
"name": "native-sentry-unknown", | ||
"version": "1.0.0", | ||
"main": "src/main.js", | ||
"dependencies": { | ||
"@sentry/electron": "5.6.0" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
description: Native Unknown Crash | ||
category: Native (Sentry Uploader) | ||
command: yarn | ||
condition: usesCrashpad | ||
runTwice: true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
<!DOCTYPE html> | ||
<html> | ||
<head> | ||
<meta charset="UTF-8" /> | ||
</head> | ||
<body> | ||
<script> | ||
const { init } = require('@sentry/electron/renderer'); | ||
|
||
init({ | ||
debug: true, | ||
}); | ||
</script> | ||
</body> | ||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
const path = require('path'); | ||
const { writeFileSync } = require('fs'); | ||
|
||
const { app, BrowserWindow } = require('electron'); | ||
const { init, getCurrentScope } = require('@sentry/electron/main'); | ||
|
||
const VALID_LOOKING_MINIDUMP = Buffer.from(`MDMP${'X'.repeat(12000)}`); | ||
|
||
const minidumpPath = path.join( | ||
app.getPath('crashDumps'), | ||
process.platform === 'win32' ? 'reports' : 'completed', | ||
'0dc9e285-df8d-47b7-8147-85308b54065a.dmp' | ||
); | ||
|
||
init({ | ||
dsn: '__DSN__', | ||
debug: true, | ||
autoSessionTracking: false, | ||
onFatalError: () => {}, | ||
}); | ||
|
||
getCurrentScope().setTag('app-run', process.env.APP_FIRST_RUN ? 'first' : 'second'); | ||
|
||
app.on('ready', () => { | ||
const mainWindow = new BrowserWindow({ | ||
show: false, | ||
webPreferences: { | ||
nodeIntegration: true, | ||
contextIsolation: false, | ||
}, | ||
}); | ||
|
||
mainWindow.loadFile(path.join(__dirname, 'index.html')); | ||
|
||
if (process.env.APP_FIRST_RUN) { | ||
console.log('main process breadcrumb from first crashing run'); | ||
|
||
setTimeout(() => { | ||
writeFileSync(minidumpPath, VALID_LOOKING_MINIDUMP); | ||
|
||
setTimeout(() => { | ||
process.exit(); | ||
}); | ||
}, 2000); | ||
} else { | ||
console.log('main process breadcrumb from second run'); | ||
} | ||
}); |