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

RK-5798 - upgrade bugsnag to solve a TypeError #147

Merged
merged 1 commit into from
Apr 26, 2020
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
4 changes: 2 additions & 2 deletions afterSignHook.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,11 @@ var electron_notarize = require('electron-notarize');
module.exports = async function (params) {
// Only notarize the app on Mac OS only.
if (process.platform !== 'darwin') {
console.log("only running on MAC")
console.log("MAC Notarization Hook: only running on MAC - skipping")
return;
}
if (params.packager.constructor.name !== "MacPackager") {
console.log("only running after mac packaging")
console.log("MAC Notarization Hook: only running after mac packaging - skipping")
return;
}
console.log('afterSign hook triggered');
Expand Down
6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "explorook",
"version": "1.2.22",
"version": "1.2.23",
"description": "Rookout's site addon to support local files and folders",
"main": "dist/index.js",
"scripts": {
Expand Down Expand Up @@ -70,7 +70,7 @@
},
"license": "MIT",
"devDependencies": {
"@bugsnag/core": "^5.2.0",
"@bugsnag/core": "6.5.0",
"@material-ui/core": "^1.2.1",
"@material-ui/icons": "^1.1.0",
"@playlyfe/gql": "^2.6.0",
Expand All @@ -95,7 +95,7 @@
"webpack-node-externals": "^1.7.2"
},
"dependencies": {
"@bugsnag/js": "^5.2.0",
"@bugsnag/js": "6.5.2",
"@types/valid-url": "^1.0.2",
"analytics-node": "^3.4.0-beta.1",
"args-parser": "^1.1.0",
Expand Down
12 changes: 5 additions & 7 deletions src/exceptionManager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,9 @@ export const initExceptionManager = (releaseStage: string, appVersion: string, g
if (!exceptionManagerInstance) {
exceptionManagerInstance = bugsnag({
onUncaughtException: (err: any) => {
// override default behaviour to not crash
// https://docs.bugsnag.com/platforms/javascript/configuration-options/#onuncaughtexception-node-js-only
// override default behaviour to not crash
// https://docs.bugsnag.com/platforms/javascript/configuration-options/#onuncaughtexception-node-js-only
console.log(err)
},
apiKey: "6e673fda179162f48a2c6b5d159552d2",
appType: "explorook-electron",
Expand All @@ -26,10 +27,7 @@ export const initExceptionManager = (releaseStage: string, appVersion: string, g
return exceptionManagerInstance;
};

export const notify = (error: NotifiableError, opts?: INotifyOpts): boolean => {
if (exceptionManagerInstance) {
return exceptionManagerInstance.notify(error, opts);
}
return true;
export const notify = (error: NotifiableError, opts?: INotifyOpts) => {
exceptionManagerInstance?.notify(error, opts);
};

8 changes: 4 additions & 4 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -151,8 +151,8 @@ function registerIpc() {
e.returnValue = store.get("has-signed-eula", false);
});
ipcMain.on("signed-eula", (e: IpcMainEvent) => {
if (dataCollectionEnabled && !process.env.development) {
initExceptionManager("production", app.getVersion(), () => userId);
if (dataCollectionEnabled || process.env.development) {
initExceptionManager(process.env.development ? "development" : "production", app.getVersion(), () => userId);
initAnalytics();
track("signed-eula");
}
Expand Down Expand Up @@ -223,8 +223,8 @@ function main() {
userSite = store.getOrCreate("user-site", "default");
dataCollectionEnabled = store.get("sentry-enabled", true);
signedEula = store.get("has-signed-eula", false);
if (signedEula && dataCollectionEnabled && !process.env.development) {
initExceptionManager("production", app.getVersion(), () => userId);
if (signedEula && (dataCollectionEnabled || process.env.development)) {
initExceptionManager(process.env.development ? "development" : "production", app.getVersion(), () => userId);
initAnalytics();
}

Expand Down
2 changes: 1 addition & 1 deletion src/webapp/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"private": true,
"homepage": "./",
"dependencies": {
"@bugsnag/js": "^5.2.0",
"@bugsnag/js": "6.5.2",
"@craco/craco": "^5.2.0",
"@material-ui/core": "^1.2.1",
"@material-ui/icons": "^1.1.0",
Expand Down
Loading