Skip to content

Commit

Permalink
Merge pull request #273 from Cipulot/remove_stuff
Browse files Browse the repository at this point in the history
Remove tracking tools
  • Loading branch information
Cipulot authored Oct 8, 2024
2 parents 13b9df9 + 5f6e9f7 commit 88d4b9c
Show file tree
Hide file tree
Showing 7 changed files with 4 additions and 266 deletions.
8 changes: 0 additions & 8 deletions api/host.json
Original file line number Diff line number Diff line change
@@ -1,13 +1,5 @@
{
"version": "2.0",
"logging": {
"applicationInsights": {
"samplingSettings": {
"isEnabled": true,
"excludedTypes": "Request"
}
}
},
"extensionBundle": {
"id": "Microsoft.Azure.Functions.ExtensionBundle",
"version": "[2.*, 3.0.0)"
Expand Down
224 changes: 0 additions & 224 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 0 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,6 @@
"@react-three/drei": "^9.56.27",
"@react-three/fiber": "^8.11.5",
"@reduxjs/toolkit": "^1.9.3",
"@sentry/react": "^7.42.0",
"@sentry/tracing": "^7.42.0",
"@the-via/pelpi": "^0.0.3",
"@the-via/reader": "^1.9.0",
"@webscopeio/react-textarea-autocomplete": "^4.9.2",
Expand Down
3 changes: 0 additions & 3 deletions src/Routes.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ import {useMemo, useState} from 'react';
import {OVERRIDE_HID_CHECK} from './utils/override';
import {useAppSelector} from './store/hooks';
import {getRenderMode} from './store/settingsSlice';
import {ErrorBoundary} from '@sentry/react';

const GlobalStyle = createGlobalStyle`
*:focus {
Expand All @@ -36,15 +35,13 @@ export default () => {
const testContextState = useState({clearTestKeys: () => {}});
return (
<>
<ErrorBoundary showDialog={true}>
<TestContext.Provider value={testContextState}>
<GlobalStyle />
{hasHIDSupport && <UnconnectedGlobalMenu />}
<CanvasRouter />

<Home hasHIDSupport={hasHIDSupport}>{RouteComponents}</Home>
</TestContext.Provider>
</ErrorBoundary>
</>
);
};
18 changes: 0 additions & 18 deletions src/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,27 +9,9 @@ import {
} from './utils/device-store';
import {updateCSSVariables} from './utils/color-math';
import {THEMES} from './utils/themes';
import * as Sentry from '@sentry/react';
import {BrowserTracing} from '@sentry/tracing';

const {MODE} = import.meta.env;

Sentry.init({
dsn: 'https://1083464e2a864de791972ab8c976849a@o4504817817747456.ingest.sentry.io/4504817834655749',
integrations: [new BrowserTracing()],
tracesSampleRate: 1.0,
normalizeDepth: 10,
environment: MODE,
});

const appInsights = new ApplicationInsights({
config: {
instrumentationKey: 'b3c046b8-137c-47f3-b28d-9049abfa9fe8',
/* ...Other Configuration Options... */
},
});
appInsights.loadAppInsights();
appInsights.trackPageView(); // Manually call trackPageView to establish the current user/session/pageview
const elem = document.getElementById('root');
if (elem) {
const root = createRoot(elem);
Expand Down
11 changes: 4 additions & 7 deletions src/store/errorsListener.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,22 +4,19 @@ import {
logAppError,
logKeyboardAPIError,
} from './errorsSlice';
import * as Sentry from '@sentry/react';
import {formatNumberAsHex} from 'src/utils/format';
import {DeviceInfo} from 'src/types/types';

export const errorsListenerMiddleware = createListenerMiddleware();

const captureError = (message: string, deviceInfo: DeviceInfo) => {
Sentry.captureException(new Error(message), {
tags: {
console.error('Error captured:', {
message,
deviceInfo: {
productName: deviceInfo.productName,
vendorId: formatNumberAsHex(deviceInfo.vendorId, 4),
protocol: deviceInfo.protocol,
},
extra: {
deviceInfo: deviceInfo,
},
});
};

Expand All @@ -38,4 +35,4 @@ errorsListenerMiddleware.startListening({
payload.deviceInfo,
);
},
});
});
4 changes: 0 additions & 4 deletions src/store/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,8 @@ import lightingReducer from './lightingSlice';
import menusReducer from './menusSlice';
import designReducer from './designSlice';
import errorsReducer from './errorsSlice';
import * as Sentry from '@sentry/react';
import {errorsListenerMiddleware} from './errorsListener';

const sentryEnhancer = Sentry.createReduxEnhancer({});

export const store = configureStore({
reducer: {
settings: settingsReducer,
Expand All @@ -25,7 +22,6 @@ export const store = configureStore({
design: designReducer,
errors: errorsReducer,
},
enhancers: [sentryEnhancer],
middleware: (getDefaultMiddleware) =>
getDefaultMiddleware().prepend(errorsListenerMiddleware.middleware),
});
Expand Down

0 comments on commit 88d4b9c

Please sign in to comment.