Skip to content
Snippets Groups Projects
Commit 624e3c9a authored by James Long's avatar James Long
Browse files

Remove tracking

parent 4a79090d
No related branches found
No related tags found
No related merge requests found
...@@ -51,7 +51,7 @@ We should switch to [swc](https://swc.rs). That would also have another benefit: ...@@ -51,7 +51,7 @@ We should switch to [swc](https://swc.rs). That would also have another benefit:
One of my mistakes with Actual was rebuilding everything from scratch, even the design system. While I was able to make it look good for the current version of Actual, it makes it a lot of work to build new designs. We should choose a 3rd party library and start using it in Actual. It would make it way faster to build new designs. One of my mistakes with Actual was rebuilding everything from scratch, even the design system. While I was able to make it look good for the current version of Actual, it makes it a lot of work to build new designs. We should choose a 3rd party library and start using it in Actual. It would make it way faster to build new designs.
There aren't many good 3rd party library unfortunately. API, accessibility, and general thoughtful-ness are important. The two that come to my mind are [Radix](https://www.radix-ui.com) and (react-aria)[https://react-spectrum.adobe.com/react-aria/]. I'm leaning towards react-aria. There aren't many good 3rd party library unfortunately. API, accessibility, and general thoughtful-ness are important. The two that come to my mind are [Radix](https://www.radix-ui.com) and [react-aria](https://react-spectrum.adobe.com/react-aria/). I'm leaning towards react-aria.
I'm open to other things, but we really need something to take the weight off of building UI. I'm open to other things, but we really need something to take the weight off of building UI.
......
...@@ -5,7 +5,7 @@ If you are only interested in running the latest version, you don't need this re ...@@ -5,7 +5,7 @@ If you are only interested in running the latest version, you don't need this re
More docs are available in the [docs](https://github.com/actualbudget/actual/tree/master/docs) folder. More docs are available in the [docs](https://github.com/actualbudget/actual/tree/master/docs) folder.
If you are interested in contributed, or want to know how development works, see [CONTRIBUTING.md](https://github.com/actualbudget/actual/blob/master/CONTRIBUTING.md) If you are interested in contributing, or want to know how development works, see [CONTRIBUTING.md](https://github.com/actualbudget/actual/blob/master/CONTRIBUTING.md)
## Installation ## Installation
...@@ -56,7 +56,6 @@ In the root of the project: ...@@ -56,7 +56,6 @@ In the root of the project:
``` ```
yarn start # Run the electron app yarn start # Run the electron app
yarn start:browser # Run the web app yarn start:browser # Run the web app
``` ```
## Code structure ## Code structure
......
import * as Sentry from '@sentry/browser';
import { SentryMetricIntegration } from '@jlongster/sentry-metrics-actual';
import { initBackend as initSQLBackend } from 'absurd-sql/dist/indexeddb-main-thread'; import { initBackend as initSQLBackend } from 'absurd-sql/dist/indexeddb-main-thread';
// eslint-disable-next-line import/no-webpack-loader-syntax // eslint-disable-next-line import/no-webpack-loader-syntax
import BackendWorker from 'worker-loader!./browser-server'; import BackendWorker from 'worker-loader!./browser-server';
...@@ -13,23 +11,6 @@ let IS_DEV = process.env.NODE_ENV === 'development'; ...@@ -13,23 +11,6 @@ let IS_DEV = process.env.NODE_ENV === 'development';
let IS_PERF_BUILD = process.env.PERF_BUILD != null; let IS_PERF_BUILD = process.env.PERF_BUILD != null;
let ACTUAL_VERSION = process.env.REACT_APP_ACTUAL_VERSION; let ACTUAL_VERSION = process.env.REACT_APP_ACTUAL_VERSION;
if (!IS_DEV) {
Sentry.init({
dsn: 'https://9e6094adfc9f43b5b5b9994cee44d7c2@sentry.io/5169928',
release: ACTUAL_VERSION,
ignoreErrors: ['ResizeObserver loop'],
integrations: [
new SentryMetricIntegration({
url: 'https://sync.actualbudget.com/metrics',
metric: 'app-errors',
dimensions: { platform: 'web' }
})
]
});
window.SentryClient = Sentry;
}
// *** Start the backend *** // *** Start the backend ***
let worker; let worker;
...@@ -68,8 +49,6 @@ function createBackendWorker() { ...@@ -68,8 +49,6 @@ function createBackendWorker() {
createBackendWorker(); createBackendWorker();
global.SentryClient = Sentry;
if (IS_DEV || IS_PERF_BUILD) { if (IS_DEV || IS_PERF_BUILD) {
import('perf-deets/frontend').then(({ listenForPerfData }) => { import('perf-deets/frontend').then(({ listenForPerfData }) => {
listenForPerfData(window); listenForPerfData(window);
......
import asyncStorage from '../../platform/server/asyncStorage'; import asyncStorage from '../../platform/server/asyncStorage';
import { sha256String } from '../encryption-internals'; import { sha256String } from '../encryption-internals';
let Mixpanel = require('@jlongster/mixpanel');
let uuid = require('../../platform/uuid'); let uuid = require('../../platform/uuid');
let currentUniqueId; let currentUniqueId;
...@@ -28,53 +27,9 @@ function isAnonymous(id) { ...@@ -28,53 +27,9 @@ function isAnonymous(id) {
} }
export async function init() { export async function init() {
mixpanel = Mixpanel.init('7e6461b8dde1d5dbf04ed1711768257a');
let [
[, distinctId],
[, userId],
[, trackUsage]
] = await asyncStorage.multiGet(['distinct-id-v2', 'user-id', 'track-usage']);
toggle(trackUsage);
if (distinctId == null) {
if (userId) {
let hashedId = await hash(userId);
currentUniqueId = hashedId;
setProfile({ $name: hashedId });
} else {
currentUniqueId = uuid.v4Sync();
}
await asyncStorage.setItem('distinct-id-v2', currentUniqueId);
} else {
currentUniqueId = distinctId;
if (!isAnonymous(distinctId)) {
setProfile({ $name: distinctId });
}
}
} }
export async function login(userId) { export async function login(userId) {
let hashedId = await hash(userId);
await asyncStorage.setItem('distinct-id-v2', hashedId);
if (isAnonymous(currentUniqueId)) {
mixpanel.identify(hashedId, currentUniqueId);
startBuffering();
// So ridiculous. https://help.mixpanel.com/hc/en-us/articles/115004497803-Identity-Management-Best-Practices#serverside-aliasing
setTimeout(() => {
stopBuffering();
}, 2000);
currentUniqueId = hashedId;
setProfile({ $name: hashedId });
} else {
currentUniqueId = hashedId;
}
} }
let BUFFERING = false; let BUFFERING = false;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment