-
-
Notifications
You must be signed in to change notification settings - Fork 56
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: Ensure context from previous run is used for native main crashes (…
- Loading branch information
Showing
8 changed files
with
195 additions
and
33 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
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
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,72 @@ | ||
{ | ||
"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-main-update", | ||
"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, | ||
"language": "{{language}}" | ||
}, | ||
"node": { | ||
"name": "Node", | ||
"type": "runtime", | ||
"version": "{{version}}" | ||
}, | ||
"os": { | ||
"name": "{{platform}}", | ||
"version": "{{version}}" | ||
}, | ||
"runtime": { | ||
"name": "Electron", | ||
"version": "{{version}}" | ||
} | ||
}, | ||
"release": "native-sentry-main-update@1.0.0", | ||
"environment": "development", | ||
"user": { | ||
"ip_address": "{{auto}}" | ||
}, | ||
"event_id": "{{id}}", | ||
"timestamp": 0, | ||
"breadcrumbs": [], | ||
"tags": { | ||
"event.environment": "native", | ||
"event.origin": "electron", | ||
"event.process": "browser", | ||
"event_type": "native" | ||
} | ||
}, | ||
"attachments": [ { "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-main-update", | ||
"version": "1.0.0", | ||
"main": "src/main.js", | ||
"dependencies": { | ||
"@sentry/electron": "3.0.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,4 @@ | ||
description: Native Main Crash (after update) | ||
category: Native (Sentry Uploader) | ||
command: yarn | ||
runTwice: true |
15 changes: 15 additions & 0 deletions
15
test/e2e/test-apps/native-sentry/main-update/src/index.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,15 @@ | ||
<!DOCTYPE html> | ||
<html> | ||
<head> | ||
<meta charset="UTF-8" /> | ||
</head> | ||
<body> | ||
<script> | ||
const { init } = require('@sentry/electron'); | ||
|
||
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,32 @@ | ||
const path = require('path'); | ||
|
||
const { app, BrowserWindow } = require('electron'); | ||
const { init } = require('@sentry/electron'); | ||
|
||
init({ | ||
dsn: '__DSN__', | ||
release: process.env.APP_FIRST_RUN ? 'native-sentry-main-update@1.0.0' : 'native-sentry-main-update@2.0.0', | ||
debug: true, | ||
autoSessionTracking: false, | ||
onFatalError: () => {}, | ||
}); | ||
|
||
app.on('ready', () => { | ||
const mainWindow = new BrowserWindow({ | ||
show: false, | ||
webPreferences: { | ||
nodeIntegration: true, | ||
contextIsolation: false, | ||
}, | ||
}); | ||
|
||
mainWindow.loadFile(path.join(__dirname, 'index.html')); | ||
|
||
// We only crash on the first run | ||
// The second run is where the crash is uploaded | ||
if (process.env.APP_FIRST_RUN) { | ||
setTimeout(() => { | ||
process.crash(); | ||
}, 1000); | ||
} | ||
}); |
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