-
-
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.
fix: Duplicate crashed sessions (#961)
- Loading branch information
Showing
11 changed files
with
264 additions
and
3 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
73 changes: 73 additions & 0 deletions
73
test/e2e/test-apps/sessions/native-crash-renderer-multiple/event.json
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,73 @@ | ||
{ | ||
"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": "session-native-crash-renderer-multiple", | ||
"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}}" | ||
}, | ||
"electron": { | ||
"crashed_url": "app:///src/index.html" | ||
} | ||
}, | ||
"release": "session-native-crash-renderer-multiple@1.0.0", | ||
"environment": "development", | ||
"event_id": "{{id}}", | ||
"timestamp": 0, | ||
"breadcrumbs": [], | ||
"tags": { | ||
"event.environment": "native", | ||
"event.origin": "electron", | ||
"event.process": "renderer" | ||
} | ||
} | ||
} |
73 changes: 73 additions & 0 deletions
73
test/e2e/test-apps/sessions/native-crash-renderer-multiple/event2.json
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,73 @@ | ||
{ | ||
"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": "session-native-crash-renderer-multiple", | ||
"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}}" | ||
}, | ||
"electron": { | ||
"crashed_url": "app:///src/index.html" | ||
} | ||
}, | ||
"release": "session-native-crash-renderer-multiple@1.0.0", | ||
"environment": "development", | ||
"event_id": "{{id}}", | ||
"timestamp": 0, | ||
"breadcrumbs": [], | ||
"tags": { | ||
"event.environment": "native", | ||
"event.origin": "electron", | ||
"event.process": "renderer" | ||
} | ||
} | ||
} |
8 changes: 8 additions & 0 deletions
8
test/e2e/test-apps/sessions/native-crash-renderer-multiple/package.json
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": "session-native-crash-renderer-multiple", | ||
"version": "1.0.0", | ||
"main": "src/main.js", | ||
"dependencies": { | ||
"@sentry/electron": "3.0.0" | ||
} | ||
} |
3 changes: 3 additions & 0 deletions
3
test/e2e/test-apps/sessions/native-crash-renderer-multiple/recipe.yml
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,3 @@ | ||
description: Session with Multiple Native Renderer Crashes | ||
category: Sessions | ||
command: yarn |
17 changes: 17 additions & 0 deletions
17
test/e2e/test-apps/sessions/native-crash-renderer-multiple/session-crash.json
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,17 @@ | ||
{ | ||
"appId": "277345", | ||
"sentryKey": "37f8a2ee37c0409d8970bc7559c7c7e4", | ||
"method": "envelope", | ||
"data": { | ||
"sid": "{{id}}", | ||
"init": false, | ||
"started": 0, | ||
"timestamp": 0, | ||
"status": "crashed", | ||
"errors": 1, | ||
"duration": 0, | ||
"attrs": { | ||
"release": "session-native-crash-renderer-multiple@1.0.0" | ||
} | ||
} | ||
} |
17 changes: 17 additions & 0 deletions
17
test/e2e/test-apps/sessions/native-crash-renderer-multiple/session-next.json
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,17 @@ | ||
{ | ||
"appId": "277345", | ||
"sentryKey": "37f8a2ee37c0409d8970bc7559c7c7e4", | ||
"method": "envelope", | ||
"data": { | ||
"sid": "{{id}}", | ||
"init": false, | ||
"started": 0, | ||
"timestamp": 0, | ||
"status": "ok", | ||
"errors": 0, | ||
"duration": 0, | ||
"attrs": { | ||
"release": "session-native-crash-renderer-multiple@1.0.0" | ||
} | ||
} | ||
} |
17 changes: 17 additions & 0 deletions
17
test/e2e/test-apps/sessions/native-crash-renderer-multiple/session-start.json
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,17 @@ | ||
{ | ||
"appId": "277345", | ||
"sentryKey": "37f8a2ee37c0409d8970bc7559c7c7e4", | ||
"method": "envelope", | ||
"data": { | ||
"sid": "{{id}}", | ||
"init": true, | ||
"started": 0, | ||
"timestamp": 0, | ||
"status": "ok", | ||
"errors": 0, | ||
"duration": 0, | ||
"attrs": { | ||
"release": "session-native-crash-renderer-multiple@1.0.0" | ||
} | ||
} | ||
} |
19 changes: 19 additions & 0 deletions
19
test/e2e/test-apps/sessions/native-crash-renderer-multiple/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,19 @@ | ||
<!DOCTYPE html> | ||
<html> | ||
<head> | ||
<meta charset="UTF-8" /> | ||
</head> | ||
<body> | ||
<script> | ||
const { init } = require('@sentry/electron/renderer'); | ||
|
||
init({ | ||
debug: true, | ||
}); | ||
|
||
setTimeout(() => { | ||
process.crash(); | ||
}, 500); | ||
</script> | ||
</body> | ||
</html> |
35 changes: 35 additions & 0 deletions
35
test/e2e/test-apps/sessions/native-crash-renderer-multiple/src/main.js
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,35 @@ | ||
const path = require('path'); | ||
|
||
const { app, BrowserWindow } = require('electron'); | ||
const { init, mainProcessSessionIntegration } = require('@sentry/electron/main'); | ||
|
||
init({ | ||
dsn: '__DSN__', | ||
debug: true, | ||
integrations: [mainProcessSessionIntegration({ sendOnCreate: true })], | ||
onFatalError: () => {}, | ||
}); | ||
|
||
function createWindow() { | ||
const mainWindow = new BrowserWindow({ | ||
show: false, | ||
webPreferences: { | ||
nodeIntegration: true, | ||
contextIsolation: false, | ||
}, | ||
}); | ||
|
||
mainWindow.loadFile(path.join(__dirname, 'index.html')); | ||
} | ||
|
||
app.on('ready', () => { | ||
createWindow(); | ||
}); | ||
|
||
setTimeout(() => { | ||
createWindow(); | ||
}, 3000); | ||
|
||
setTimeout(() => { | ||
app.quit(); | ||
}, 10000); |
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