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

Added electron crash reporter using sentry #2320

Merged
merged 2 commits into from
Nov 10, 2023
Merged
Show file tree
Hide file tree
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
2 changes: 1 addition & 1 deletion packages/altair-app/jest.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,6 @@ module.exports = {
setupFilesAfterEnv: ['<rootDir>/src/setup-jest.ts'],
moduleDirectories: ['node_modules', 'src'],
transformIgnorePatterns: [
'node_modules/(?!@angular|@firebase|@ngrx|lodash-es|altair-graphql-core|angular-resizable-element|dexie|uuid|ngx-cookie-service|ngx-markdown|ky|color-name|json-schema-library)',
'node_modules/(?!@angular|@firebase|@ngrx|@sentry|lodash-es|altair-graphql-core|angular-resizable-element|dexie|uuid|ngx-cookie-service|ngx-markdown|ky|color-name|json-schema-library)',
],
};
1 change: 1 addition & 0 deletions packages/altair-app/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@
"@ngui/auto-complete": "3.0.0",
"@ngx-translate/core": "12.1.2",
"@ngx-translate/http-loader": "4.0.0",
"@sentry/electron": "^4.14.0",
"@supabase/supabase-js": "1.29.1",
"@webcomponents/custom-elements": "1.4.1",
"abab": "2.0.6",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import { take } from 'rxjs/operators';
import { Injectable, NgZone } from '@angular/core';
import { Store } from '@ngrx/store';
import { init } from '@sentry/electron';

import { NotifyService } from '../notify/notify.service';

Expand Down Expand Up @@ -88,6 +89,8 @@ export class ElectronAppService {
return;
}

init({});

this.api.events.onFileOpened((content) => {
this.zone.run(() => importFileContent(content));
});
Expand Down
2 changes: 2 additions & 0 deletions packages/altair-electron/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
"dependencies": {
"@altairgraphql/electron-interop": "^5.2.5",
"@altairgraphql/login-redirect": "^5.2.5",
"@sentry/electron": "^4.14.0",
"altair-static": "^5.2.5",
"body-parser": "^1.20.0",
"csp-header": "^5.1.0",
Expand All @@ -33,6 +34,7 @@
"@electron/notarize": "^2.1.0",
"@jest/globals": "28.0.0",
"@playwright/test": "1.31.2",
"@sentry/wizard": "^3.16.2",
"@types/jest": "^28.1.7",
"@types/mime-types": "^2.1.1",
"devtron": "^1.4.0",
Expand Down
4 changes: 4 additions & 0 deletions packages/altair-electron/src/index.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
import unhandled from 'electron-unhandled';
import * as Sentry from '@sentry/electron';
import { ElectronApp } from './app';

Sentry.init({
dsn: 'https://1b08762f991476e3115e1ab7d12e6682@o4506180788879360.ingest.sentry.io/4506198594813952',
});
new ElectronApp();
unhandled({ showDialog: false });
2 changes: 1 addition & 1 deletion site/src/docs/features/prerequest-scripts.md
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ altair.helpers.getEnvironment('api_key')
altair.helpers.setEnvironment('api_key', 'a482djksd289xxxxxxxxx');
```

**altair.helpers.getCookie(key: string)** - Retrieves a value stored in browser cookie.
**altair.helpers.getCookie(key: string)** - Retrieves a value stored in browser cookie. You need to specify the list of cookies you want to grant access to in the pre request script in the `script.allowedCookies` settings.

```js
const sessid = altair.helpers.getCookie('sessid');
Expand Down
Loading
Loading