Skip to content

Commit cbff791

Browse files
committed
Removed segment analytics
1 parent 330ec2a commit cbff791

File tree

3 files changed

+31
-121
lines changed

3 files changed

+31
-121
lines changed

package.json

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,6 @@
8989
"@material-ui/core": "^1.2.1",
9090
"@material-ui/icons": "^1.1.0",
9191
"@playlyfe/gql": "^2.6.0",
92-
"@types/analytics-node": "^3.1.1",
9392
"@types/auto-launch": "^5.0.0",
9493
"@types/aws-lambda": "^8.10.17",
9594
"@types/body-parser": "^1.17.0",
@@ -118,7 +117,6 @@
118117
"@electron/notarize": "^2.1.0",
119118
"@electron/remote": "2.0.10",
120119
"@graphql-tools/schema": "^8.3.13",
121-
"@segment/analytics-node": "^2.1.0",
122120
"apollo-server-express": "3.13.0",
123121
"args-parser": "^1.1.0",
124122
"auto-launch": "^5.0.5",

src/index.ts

Lines changed: 1 addition & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@ import {
22
enable as remoteEnable,
33
initialize as initElectronRemote
44
} from "@electron/remote/main";
5-
import Analytics from "@segment/analytics-node";
65
import {
76
app,
87
BrowserWindow,
@@ -18,12 +17,6 @@ import * as log from "electron-log";
1817
import * as Store from "electron-store";
1918
import {autoUpdater, UpdateInfo} from "electron-updater";
2019
import fs = require("fs");
21-
import {
22-
arch as operatingSystemArch,
23-
platform as operatingSystemPlatform,
24-
userInfo,
25-
version as operatingSystemVersion
26-
} from "os";
2720
import * as path from "path";
2821
import {deeplinkHandler, initDeeplinks} from "./deeplinks";
2922
import { ExplorookStore } from "./explorook-store";
@@ -57,7 +50,6 @@ let store: ExplorookStore;
5750
let willUpdateOnClose: boolean = false;
5851
let dataCollectionEnabled: boolean;
5952
const icon = nativeImage.createFromPath(APP_ICON);
60-
let analytics: Analytics;
6153
let userId: string;
6254

6355
// getAppIcon resolves the right icon for the running platform
@@ -119,10 +111,6 @@ function registerIpc() {
119111
ipcMain.on("hidden", displayWindowHiddenNotification);
120112
ipcMain.on("start-server-error", (e: IpcMainEvent, err: any) => {
121113
displayNotification("Rookout Desktop App", `App failed to start local server: ${err}`);
122-
track("start-server-error", { err });
123-
});
124-
ipcMain.on("track", (e: IpcMainEvent, trackEvent: string, props: any) => {
125-
track(trackEvent, props);
126114
});
127115
ipcMain.on("get-user-id", (e: IpcMainEvent) => e.returnValue = userId);
128116
ipcMain.on("get-platform", (e: IpcMainEvent) => e.returnValue = process.platform.toString());
@@ -156,44 +144,9 @@ function registerIpc() {
156144
});
157145
}
158146

159-
function track(eventName: string, props: any = null, callback: (() => void) | null = null): void {
160-
if (!analytics) {
161-
return;
162-
}
163-
analytics.track({
164-
userId,
165-
event: eventName,
166-
properties: props
167-
}, callback);
168-
}
169-
170-
async function flushAnalytics(callback: () => void) {
171-
if (!analytics) {
172-
return;
173-
}
174-
await analytics.closeAndFlush();
175-
callback();
176-
}
177-
178-
function identifyAnalytics() {
179-
const { username } = userInfo();
180-
const osArch = operatingSystemArch();
181-
const osPlatform = operatingSystemPlatform();
182-
const osVersion = operatingSystemVersion();
183-
analytics.identify({ userId, traits: { username, osPlatform, osArch, osVersion } });
184-
}
185-
186-
function initAnalytics() {
187-
analytics = new Analytics({ writeKey: "isfxG3NQsq3qDoNPZPvhIVlmYVGDOLdH"});
188-
identifyAnalytics();
189-
track("startup");
190-
}
191147

192148
async function quitApplication() {
193-
track("quit-application");
194-
await flushAnalytics(() => app.quit());
195-
// This timeout is here in case the callback is not called or takes too long
196-
setTimeout(() => app.quit(), 3000);
149+
app.quit();
197150
}
198151

199152
function main() {
@@ -227,7 +180,6 @@ function main() {
227180

228181
if (dataCollectionEnabled || process.env.development) {
229182
initExceptionManager(() => userId);
230-
initAnalytics();
231183
}
232184

233185
// listen to RPC's coming from windows

yarn.lock

Lines changed: 30 additions & 70 deletions
Original file line numberDiff line numberDiff line change
@@ -455,18 +455,6 @@
455455
"@jridgewell/resolve-uri" "^3.1.0"
456456
"@jridgewell/sourcemap-codec" "^1.4.14"
457457

458-
"@lukeed/csprng@^1.1.0":
459-
version "1.1.0"
460-
resolved "https://registry.yarnpkg.com/@lukeed/csprng/-/csprng-1.1.0.tgz#1e3e4bd05c1cc7a0b2ddbd8a03f39f6e4b5e6cfe"
461-
integrity sha512-Z7C/xXCiGWsg0KuKsHTKJxbWhpI3Vs5GwLfOean7MGyVFGqdRgBbAjOCh6u4bbjPc/8MJ2pZmK/0DLdCbivLDA==
462-
463-
"@lukeed/uuid@^2.0.0":
464-
version "2.0.1"
465-
resolved "https://registry.yarnpkg.com/@lukeed/uuid/-/uuid-2.0.1.tgz#4f6c34259ee0982a455e1797d56ac27bb040fd74"
466-
integrity sha512-qC72D4+CDdjGqJvkFMMEAtancHUQ7/d/tAiHf64z8MopFDmcrtbcJuerDtFceuAfQJ2pDSfCKCtbqoGBNnwg0w==
467-
dependencies:
468-
"@lukeed/csprng" "^1.1.0"
469-
470458
"@malept/cross-spawn-promise@^1.1.0":
471459
version "1.1.1"
472460
resolved "https://registry.yarnpkg.com/@malept/cross-spawn-promise/-/cross-spawn-promise-1.1.1.tgz#504af200af6b98e198bce768bc1730c6936ae01d"
@@ -607,36 +595,6 @@
607595
resolved "https://registry.yarnpkg.com/@protobufjs/utf8/-/utf8-1.1.0.tgz#a777360b5b39a1a2e5106f8e858f2fd2d060c570"
608596
integrity sha512-Vvn3zZrhQZkkBE8LSuW3em98c0FwgO4nxzv6OdSxPKJIEKY2bGbHn+mhGIPerzI4twdxaP8/0+06HBpwf345Lw==
609597

610-
"@segment/[email protected]":
611-
version "1.5.0"
612-
resolved "https://registry.yarnpkg.com/@segment/analytics-core/-/analytics-core-1.5.0.tgz#c1dcd73267b7928b695403c111333343674943a4"
613-
integrity sha512-xFM9sS4ltRWDnNE6bD/bwLAGGBI1Doidf35J6ePyuOfecZ7c0sADtk9xR1QD98CDDFVaQcrfV/O1l4rBZvCm4A==
614-
dependencies:
615-
"@lukeed/uuid" "^2.0.0"
616-
"@segment/analytics-generic-utils" "1.2.0"
617-
dset "^3.1.2"
618-
tslib "^2.4.1"
619-
620-
"@segment/[email protected]":
621-
version "1.2.0"
622-
resolved "https://registry.yarnpkg.com/@segment/analytics-generic-utils/-/analytics-generic-utils-1.2.0.tgz#9232162d6dbcd18501813fdff18035ce48fd24bf"
623-
integrity sha512-DfnW6mW3YQOLlDQQdR89k4EqfHb0g/3XvBXkovH1FstUN93eL1kfW9CsDcVQyH3bAC5ZsFyjA/o/1Q2j0QeoWw==
624-
dependencies:
625-
tslib "^2.4.1"
626-
627-
"@segment/analytics-node@^2.1.0":
628-
version "2.1.0"
629-
resolved "https://registry.yarnpkg.com/@segment/analytics-node/-/analytics-node-2.1.0.tgz#6b4f8c3ea3893dc3515bd8a4efdac99deedeb7f5"
630-
integrity sha512-o50FA7CjfqnaSCPZ93DI15hOrqdu4fEYJFBlYkh7kbrARGTSGi3T5CRp3uM/un9oz0cJFoP/0+a2urXlAGE9aw==
631-
dependencies:
632-
"@lukeed/uuid" "^2.0.0"
633-
"@segment/analytics-core" "1.5.0"
634-
"@segment/analytics-generic-utils" "1.2.0"
635-
buffer "^6.0.3"
636-
jose "^5.1.0"
637-
node-fetch "^2.6.7"
638-
tslib "^2.4.1"
639-
640598
"@sindresorhus/is@^4.0.0":
641599
version "4.6.0"
642600
resolved "https://registry.yarnpkg.com/@sindresorhus/is/-/is-4.6.0.tgz#3c7c9c46e678feefe7a2e5bb609d3dbd665ffb3f"
@@ -661,11 +619,6 @@
661619
dependencies:
662620
"@types/node" "*"
663621

664-
"@types/analytics-node@^3.1.1":
665-
version "3.1.14"
666-
resolved "https://registry.yarnpkg.com/@types/analytics-node/-/analytics-node-3.1.14.tgz#aa4be9cddbb2b7901e67418fcaf155a599c1ffea"
667-
integrity sha512-m7+SReJIPwwS0eqnJ+5WwdR4U5aU0WhVUYuQ/n177iPpyXObPy/wP7HU7mohyNeRqxGsTO8mIUYC3MRGkyxhwQ==
668-
669622
"@types/auto-launch@^5.0.0":
670623
version "5.0.5"
671624
resolved "https://registry.yarnpkg.com/@types/auto-launch/-/auto-launch-5.0.5.tgz#439ed36aaaea501e2e2cfbddd8a20c366c34863b"
@@ -1640,14 +1593,6 @@ buffer@^5.1.0:
16401593
base64-js "^1.3.1"
16411594
ieee754 "^1.1.13"
16421595

1643-
buffer@^6.0.3:
1644-
version "6.0.3"
1645-
resolved "https://registry.yarnpkg.com/buffer/-/buffer-6.0.3.tgz#2ace578459cc8fbe2a70aaa8f52ee63b6a74c6c6"
1646-
integrity sha512-FTiCpNxtwiZZHEZbcbTIcZjERVICn9yq/pDFkTl95/AxzD1naBctN7YO68riM/gLSDY7sdrMby8hofADYuuqOA==
1647-
dependencies:
1648-
base64-js "^1.3.1"
1649-
ieee754 "^1.2.1"
1650-
16511596
bugsnag-build-reporter@^2.0.0:
16521597
version "2.0.0"
16531598
resolved "https://registry.yarnpkg.com/bugsnag-build-reporter/-/bugsnag-build-reporter-2.0.0.tgz#da088c673655d544ccbd05c0d0d05c739e896753"
@@ -2367,11 +2312,6 @@ dotenv@^9.0.2:
23672312
resolved "https://registry.yarnpkg.com/dotenv/-/dotenv-9.0.2.tgz#dacc20160935a37dea6364aa1bef819fb9b6ab05"
23682313
integrity sha512-I9OvvrHp4pIARv4+x9iuewrWycX6CcZtoAu1XrzPxc5UygMJXJZYmBsynku8IkrJwgypE5DGNjDPmPRhDCptUg==
23692314

2370-
dset@^3.1.2:
2371-
version "3.1.3"
2372-
resolved "https://registry.yarnpkg.com/dset/-/dset-3.1.3.tgz#c194147f159841148e8e34ca41f638556d9542d2"
2373-
integrity sha512-20TuZZHCEZ2O71q9/+8BwKwZ0QtD9D8ObhrihJPr+vLLYlSuAU3/zL4cSlgbfeoGHTjCSJBa7NGcrF9/Bx/WJQ==
2374-
23752315
eastasianwidth@^0.2.0:
23762316
version "0.2.0"
23772317
resolved "https://registry.yarnpkg.com/eastasianwidth/-/eastasianwidth-0.2.0.tgz#696ce2ec0aa0e6ea93a397ffcf24aa7840c827cb"
@@ -3268,7 +3208,7 @@ [email protected]:
32683208
resolved "https://registry.yarnpkg.com/ieee754/-/ieee754-1.1.13.tgz#ec168558e95aa181fd87d37f55c32bbcb6708b84"
32693209
integrity sha512-4vf7I2LYV/HaWerSo3XmlMkp5eZ83i+/CDluXi/IGTs/O1sejBNhTtnxzmRZfvOUqj7lZjqHkeTvpgSFDlWZTg==
32703210

3271-
ieee754@^1.1.13, ieee754@^1.1.4, ieee754@^1.2.1:
3211+
ieee754@^1.1.13, ieee754@^1.1.4:
32723212
version "1.2.1"
32733213
resolved "https://registry.yarnpkg.com/ieee754/-/ieee754-1.2.1.tgz#8eb7a10a63fff25d15a57b001586d177d1b0d352"
32743214
integrity sha512-dcyqhDvX1C46lXZcVqCpK+FtMRQVdIMN6/Df5js2zouUsqG7I6sFxitIC+7KYK29KdXOLHdu9zL4sFnoVQnqaA==
@@ -3586,11 +3526,6 @@ [email protected]:
35863526
resolved "https://registry.yarnpkg.com/jmespath/-/jmespath-0.16.0.tgz#b15b0a85dfd4d930d43e69ed605943c802785076"
35873527
integrity sha512-9FzQjJ7MATs1tSpnco1K6ayiYE3figslrXA72G2HQ/n76RzvYlofyi5QM+iX4YRs/pu3yzxlVQSST23+dMDknw==
35883528

3589-
jose@^5.1.0:
3590-
version "5.2.3"
3591-
resolved "https://registry.yarnpkg.com/jose/-/jose-5.2.3.tgz#071c87f9fe720cff741a403c8080b69bfe13164a"
3592-
integrity sha512-KUXdbctm1uHVL8BYhnyHkgp3zDX5KW8ZhAKVFEfUbU2P8Alpzjb+48hHvjOdQIyPshoblhzsuqOwEEAbtHVirA==
3593-
35943529
35953530
version "1.0.5"
35963531
resolved "https://registry.yarnpkg.com/js-message/-/js-message-1.0.5.tgz#2300d24b1af08e89dd095bc1a4c9c9cfcb892d15"
@@ -5389,7 +5324,7 @@ streamroller@^3.1.3:
53895324
debug "^4.3.4"
53905325
fs-extra "^8.1.0"
53915326

5392-
"string-width-cjs@npm:string-width@^4.2.0", string-width@^4.1.0, string-width@^4.2.0, string-width@^4.2.3:
5327+
"string-width-cjs@npm:string-width@^4.2.0":
53935328
version "4.2.3"
53945329
resolved "https://registry.yarnpkg.com/string-width/-/string-width-4.2.3.tgz#269c7117d27b05ad2e536830a8ec895ef9c6d010"
53955330
integrity sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==
@@ -5407,6 +5342,15 @@ string-width@^1.0.1, string-width@^1.0.2:
54075342
is-fullwidth-code-point "^1.0.0"
54085343
strip-ansi "^3.0.0"
54095344

5345+
string-width@^4.1.0, string-width@^4.2.0, string-width@^4.2.3:
5346+
version "4.2.3"
5347+
resolved "https://registry.yarnpkg.com/string-width/-/string-width-4.2.3.tgz#269c7117d27b05ad2e536830a8ec895ef9c6d010"
5348+
integrity sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==
5349+
dependencies:
5350+
emoji-regex "^8.0.0"
5351+
is-fullwidth-code-point "^3.0.0"
5352+
strip-ansi "^6.0.1"
5353+
54105354
string-width@^5.0.1, string-width@^5.1.2:
54115355
version "5.1.2"
54125356
resolved "https://registry.yarnpkg.com/string-width/-/string-width-5.1.2.tgz#14f8daec6d81e7221d2a357e668cab73bdbca794"
@@ -5435,7 +5379,7 @@ string_decoder@~1.1.1:
54355379
dependencies:
54365380
safe-buffer "~5.1.0"
54375381

5438-
"strip-ansi-cjs@npm:strip-ansi@^6.0.1", strip-ansi@^6.0.0, strip-ansi@^6.0.1:
5382+
"strip-ansi-cjs@npm:strip-ansi@^6.0.1":
54395383
version "6.0.1"
54405384
resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-6.0.1.tgz#9e26c63d30f53443e9489495b2105d37b67a85d9"
54415385
integrity sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==
@@ -5449,6 +5393,13 @@ strip-ansi@^3.0.0, strip-ansi@^3.0.1:
54495393
dependencies:
54505394
ansi-regex "^2.0.0"
54515395

5396+
strip-ansi@^6.0.0, strip-ansi@^6.0.1:
5397+
version "6.0.1"
5398+
resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-6.0.1.tgz#9e26c63d30f53443e9489495b2105d37b67a85d9"
5399+
integrity sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==
5400+
dependencies:
5401+
ansi-regex "^5.0.1"
5402+
54525403
strip-ansi@^7.0.1:
54535404
version "7.1.0"
54545405
resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-7.1.0.tgz#d5b6568ca689d8561370b0707685d22434faff45"
@@ -5667,7 +5618,7 @@ tslib@^1.8.0, tslib@^1.8.1:
56675618
resolved "https://registry.yarnpkg.com/tslib/-/tslib-1.14.1.tgz#cf2d38bdc34a134bcaf1091c41f6619e2f672d00"
56685619
integrity sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg==
56695620

5670-
tslib@^2.1.0, tslib@^2.4.0, tslib@^2.4.1:
5621+
tslib@^2.1.0, tslib@^2.4.0:
56715622
version "2.6.2"
56725623
resolved "https://registry.yarnpkg.com/tslib/-/tslib-2.6.2.tgz#703ac29425e7b37cd6fd456e92404d46d1f3e4ae"
56735624
integrity sha512-AEYxH93jGFPn/a2iVAwW87VuUIkR1FVUKB77NwMF7nBTDkDrrT/Hpt/IrCJ0QXhW27jTBDcf5ZY7w6RiqTMw2Q==
@@ -6091,7 +6042,7 @@ wordwrapjs@^4.0.0:
60916042
reduce-flatten "^2.0.0"
60926043
typical "^5.2.0"
60936044

6094-
"wrap-ansi-cjs@npm:wrap-ansi@^7.0.0", wrap-ansi@^7.0.0:
6045+
"wrap-ansi-cjs@npm:wrap-ansi@^7.0.0":
60956046
version "7.0.0"
60966047
resolved "https://registry.yarnpkg.com/wrap-ansi/-/wrap-ansi-7.0.0.tgz#67e145cff510a6a6984bdf1152911d69d2eb9e43"
60976048
integrity sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q==
@@ -6108,6 +6059,15 @@ wrap-ansi@^2.0.0:
61086059
string-width "^1.0.1"
61096060
strip-ansi "^3.0.1"
61106061

6062+
wrap-ansi@^7.0.0:
6063+
version "7.0.0"
6064+
resolved "https://registry.yarnpkg.com/wrap-ansi/-/wrap-ansi-7.0.0.tgz#67e145cff510a6a6984bdf1152911d69d2eb9e43"
6065+
integrity sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q==
6066+
dependencies:
6067+
ansi-styles "^4.0.0"
6068+
string-width "^4.1.0"
6069+
strip-ansi "^6.0.0"
6070+
61116071
wrap-ansi@^8.1.0:
61126072
version "8.1.0"
61136073
resolved "https://registry.yarnpkg.com/wrap-ansi/-/wrap-ansi-8.1.0.tgz#56dc22368ee570face1b49819975d9b9a5ead214"

0 commit comments

Comments
 (0)