Skip to content

Commit 729005b

Browse files
imlucasdurran
authored andcommitted
COMPASS-619: Fix error notification icon path on Linux (#761) (#800)
* Remove old references in metrics to mixpanel * COMPASS-619: Fix error notification icon path on Linux This fixes the observed behavior on Linux which boils down to: > [An unexpected error occurs on Linux when trying to tell the user that a different unexpected error occurred][COMPASS-619] Thanks to @pzrq’s screenshot, we can see this error is coming from `src/app/metrics/index.js`: ![](https://jira.mongodb.org/secure/attachment/147242/Red+Hat+TypeError+ Cannot+read+property+%27win32%27+of+undefined.png) ## Developer Notes The `config.hadron.build` key is removed from the package.json we ship to customers at build time. Please see [`transformPackageJson()` in hadron-build](https://github.com/mongodb-js/hadron-build/blob/2434019288 c7cf3aa66e0fbc05ccb98c8a8eee47/commands/release.js#L239-L268) for more details. [COMPASS-619]: https://jira.mongodb.org/browse/COMPASS-619
1 parent c7ee031 commit 729005b

File tree

1 file changed

+4
-17
lines changed

1 file changed

+4
-17
lines changed

src/app/metrics/index.js

Lines changed: 4 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -9,37 +9,26 @@ var intercom = require('./intercom');
99
var features = require('./features');
1010
var Notifier = require('node-notifier');
1111

12+
var path = require('path');
13+
var ICON_PATH = path.join(__dirname, '..', 'images', 'compass-dialog-icon.png');
14+
1215
var debug = require('debug')('mongodb-compass:metrics');
1316

14-
// mixpanel and google analytics are currently disabled.
1517

16-
// var GA_KEY = 'UA-71150609-2';
17-
// var MIXPANEL_KEY = '6255131ccadb383ba609dae3f07631ad';
1818
var INTERCOM_KEY = 'p57suhg7';
1919
var BUGSNAG_KEY = '0d11ab5f4d97452cc83d3365c21b491c';
2020

2121
module.exports = function() {
2222
metrics.configure({
23-
// ga: {
24-
// trackingId: GA_KEY,
25-
// enabled: app.preferences.trackUsageStatistics
26-
// },
27-
// mixpanel: {
28-
// apiToken: MIXPANEL_KEY,
29-
// enabled: app.preferences.trackUsageStatistics
30-
// },
3123
intercom: {
3224
appId: INTERCOM_KEY,
3325
enabled: app.preferences.trackUsageStatistics,
3426
panelEnabled: app.preferences.enableFeedbackPanel
3527
},
3628
bugsnag: {
37-
// autoNotify: false,
3829
apiKey: BUGSNAG_KEY,
3930
metaData: {
4031
user: {
41-
'User Profile in Mixpanel': format('https://mixpanel.com/report/'
42-
+ '843929/explore/#user?distinct_id=%s', app.user.id),
4332
'User Profile in Intercom': format('https://app.intercom.io/apps'
4433
+ '/%s/users/show?user_id=%s', INTERCOM_KEY, app.user.id)
4534
}
@@ -97,10 +86,8 @@ module.exports = function() {
9786
debug('error encountered, notify trackers', err);
9887
// Notify user that error occurred
9988
if (!_.includes(err.message, 'MongoError')) {
100-
const icon = (process.platform === 'darwin') ?
101-
pkg.config.hadron.build.darwin.icon : pkg.config.hadron.build.win32.icon;
10289
Notifier.notify({
103-
'icon': icon,
90+
'icon': ICON_PATH,
10491
'message': 'Unexpected error occurred: ' + err.message,
10592
'title': 'MongoDB Compass Exception',
10693
'wait': true

0 commit comments

Comments
 (0)