Skip to content

Commit

Permalink
fix: removing sentry
Browse files Browse the repository at this point in the history
  • Loading branch information
thegrannychaseroperation committed Nov 2, 2024
1 parent 74cd60f commit 8af29ab
Show file tree
Hide file tree
Showing 24 changed files with 72 additions and 1,163 deletions.
3 changes: 1 addition & 2 deletions .env.example
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
MAIN_VITE_API_URL=API_URL
MAIN_VITE_AUTH_URL=AUTH_URL
MAIN_VITE_STEAMGRIDDB_API_KEY=YOUR_API_KEY
MAIN_VITE_SENTRY_DSN=YOUR_SENTRY_DSN
SENTRY_AUTH_TOKEN=

4 changes: 0 additions & 4 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,6 @@ jobs:
MAIN_VITE_API_URL: ${{ vars.MAIN_VITE_STAGING_API_URL }}
MAIN_VITE_AUTH_URL: ${{ vars.MAIN_VITE_STAGING_AUTH_URL }}
MAIN_VITE_CHECKOUT_URL: ${{ vars.MAIN_VITE_STAGING_CHECKOUT_URL }}
SENTRY_AUTH_TOKEN: ${{ secrets.SENTRY_AUTH_TOKEN }}
MAIN_VITE_SENTRY_DSN: ${{ vars.MAIN_VITE_SENTRY_DSN }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Build Windows
Expand All @@ -54,8 +52,6 @@ jobs:
MAIN_VITE_API_URL: ${{ vars.MAIN_VITE_STAGING_API_URL }}
MAIN_VITE_AUTH_URL: ${{ vars.MAIN_VITE_STAGING_AUTH_URL }}
MAIN_VITE_CHECKOUT_URL: ${{ vars.MAIN_VITE_STAGING_CHECKOUT_URL }}
SENTRY_AUTH_TOKEN: ${{ secrets.SENTRY_AUTH_TOKEN }}
MAIN_VITE_SENTRY_DSN: ${{ vars.MAIN_VITE_SENTRY_DSN }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Create artifact
Expand Down
4 changes: 0 additions & 4 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,6 @@ jobs:
MAIN_VITE_API_URL: ${{ vars.MAIN_VITE_API_URL }}
MAIN_VITE_AUTH_URL: ${{ vars.MAIN_VITE_AUTH_URL }}
MAIN_VITE_CHECKOUT_URL: ${{ vars.MAIN_VITE_CHECKOUT_URL }}
SENTRY_AUTH_TOKEN: ${{ secrets.SENTRY_AUTH_TOKEN }}
MAIN_VITE_SENTRY_DSN: ${{ vars.MAIN_VITE_SENTRY_DSN }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Build Windows
Expand All @@ -56,8 +54,6 @@ jobs:
MAIN_VITE_API_URL: ${{ vars.MAIN_VITE_API_URL }}
MAIN_VITE_AUTH_URL: ${{ vars.MAIN_VITE_AUTH_URL }}
MAIN_VITE_CHECKOUT_URL: ${{ vars.MAIN_VITE_CHECKOUT_URL }}
SENTRY_AUTH_TOKEN: ${{ secrets.SENTRY_AUTH_TOKEN }}
MAIN_VITE_SENTRY_DSN: ${{ vars.MAIN_VITE_SENTRY_DSN }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Create artifact
Expand Down
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,4 @@ out
*.log*
.env
.vite
sentry.properties
ludusavi/
11 changes: 2 additions & 9 deletions electron.vite.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,16 +6,9 @@ import {
externalizeDepsPlugin,
} from "electron-vite";
import react from "@vitejs/plugin-react";
import { sentryVitePlugin } from "@sentry/vite-plugin";
import { vanillaExtractPlugin } from "@vanilla-extract/vite-plugin";
import svgr from "vite-plugin-svgr";

const sentryPlugin = sentryVitePlugin({
authToken: process.env.SENTRY_AUTH_TOKEN,
org: "hydra-launcher",
project: "hydra-launcher",
});

export default defineConfig(({ mode }) => {
loadEnv(mode);

Expand All @@ -35,7 +28,7 @@ export default defineConfig(({ mode }) => {
"@shared": resolve("src/shared"),
},
},
plugins: [externalizeDepsPlugin(), swcPlugin(), sentryPlugin],
plugins: [externalizeDepsPlugin(), swcPlugin()],
},
preload: {
plugins: [externalizeDepsPlugin()],
Expand All @@ -51,7 +44,7 @@ export default defineConfig(({ mode }) => {
"@shared": resolve("src/shared"),
},
},
plugins: [svgr(), react(), vanillaExtractPlugin(), sentryPlugin],
plugins: [svgr(), react(), vanillaExtractPlugin()],
},
};
});
2 changes: 0 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@
"@hookform/resolvers": "^3.9.0",
"@primer/octicons-react": "^19.9.0",
"@reduxjs/toolkit": "^2.2.3",
"@sentry/electron": "^5.1.0",
"@vanilla-extract/css": "^1.14.2",
"@vanilla-extract/dynamic": "^2.1.1",
"@vanilla-extract/recipes": "^0.5.2",
Expand Down Expand Up @@ -83,7 +82,6 @@
"@electron-toolkit/eslint-config-prettier": "^2.0.0",
"@electron-toolkit/eslint-config-ts": "^1.0.1",
"@electron-toolkit/tsconfig": "^1.0.1",
"@sentry/vite-plugin": "^2.20.1",
"@swc/core": "^1.4.16",
"@types/auto-launch": "^5.0.5",
"@types/color": "^3.0.6",
Expand Down
5 changes: 5 additions & 0 deletions sentry.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
defaults.url=https://sentry.io/
defaults.org=hydra-launcher
defaults.project=hydra-launcher
auth.token=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
cli.executable=node_modules\\@sentry\\cli\\bin\\sentry-cli
3 changes: 0 additions & 3 deletions src/main/events/auth/get-session-hash.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import jwt from "jsonwebtoken";
import * as Sentry from "@sentry/electron/main";

import { userAuthRepository } from "@main/repository";
import { registerEvent } from "../register-event";
Expand All @@ -10,8 +9,6 @@ const getSessionHash = async (_event: Electron.IpcMainInvokeEvent) => {
if (!auth) return null;
const payload = jwt.decode(auth.accessToken) as jwt.JwtPayload;

Sentry.setContext("sessionId", payload.sessionId);

return payload.sessionId;
};

Expand Down
4 changes: 0 additions & 4 deletions src/main/events/auth/sign-out.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import { registerEvent } from "../register-event";
import * as Sentry from "@sentry/electron/main";
import {
DownloadManager,
HydraApi,
Expand Down Expand Up @@ -29,9 +28,6 @@ const signOut = async (_event: Electron.IpcMainInvokeEvent) => {
gamesPlaytime.clear();
});

/* Removes user from Sentry */
Sentry.setUser(null);

/* Cancels any ongoing downloads */
DownloadManager.cancelDownload();

Expand Down
7 changes: 0 additions & 7 deletions src/main/index.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import { app, BrowserWindow, net, protocol } from "electron";
import { init } from "@sentry/electron/main";
import updater from "electron-updater";
import i18n from "i18next";
import path from "node:path";
Expand All @@ -26,12 +25,6 @@ autoUpdater.logger = logger;
const gotTheLock = app.requestSingleInstanceLock();
if (!gotTheLock) app.quit();

if (import.meta.env.MAIN_VITE_SENTRY_DSN) {
init({
dsn: import.meta.env.MAIN_VITE_SENTRY_DSN,
});
}

app.commandLine.appendSwitch("--no-sandbox");

i18n.init({
Expand Down
1 change: 1 addition & 0 deletions src/main/services/ludusavi.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ export class Ludusavi {
workerData: {
binaryPath: this.binaryPath,
},
maxThreads: 1,
});

static async getConfig() {
Expand Down
3 changes: 0 additions & 3 deletions src/main/services/user/get-user-data.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ import {
userAuthRepository,
userSubscriptionRepository,
} from "@main/repository";
import * as Sentry from "@sentry/electron/main";
import { UserNotLoggedInError } from "@shared";
import { logger } from "../logger";

Expand Down Expand Up @@ -39,8 +38,6 @@ export const getUserData = () => {
await userSubscriptionRepository.delete({ id: 1 });
}

Sentry.setUser({ id: me.id, username: me.username });

return me;
})
.catch(async (err) => {
Expand Down
1 change: 0 additions & 1 deletion src/main/vite-env.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ interface ImportMetaEnv {
readonly MAIN_VITE_STEAMGRIDDB_API_KEY: string;
readonly MAIN_VITE_API_URL: string;
readonly MAIN_VITE_AUTH_URL: string;
readonly MAIN_VITE_SENTRY_DSN: string;
readonly MAIN_VITE_CHECKOUT_URL: string;
}

Expand Down
11 changes: 1 addition & 10 deletions src/main/workers/ludusavi.worker.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,6 @@ import { workerData } from "node:worker_threads";

const { binaryPath } = workerData;

let backupGameProcess: cp.ChildProcess | null = null;

export const backupGame = ({
title,
backupPath,
Expand All @@ -18,28 +16,21 @@ export const backupGame = ({
preview?: boolean;
winePrefix?: string;
}) => {
if (backupGameProcess && !backupGameProcess.killed) {
backupGameProcess.kill();
backupGameProcess = null;
}

return new Promise((resolve, reject) => {
const args = ["backup", title, "--api", "--force"];

if (preview) args.push("--preview");
if (backupPath) args.push("--path", backupPath);
if (winePrefix) args.push("--wine-prefix", winePrefix);

backupGameProcess = cp.execFile(
cp.execFile(
binaryPath,
args,
(err: cp.ExecFileException | null, stdout: string) => {
if (err) {
backupGameProcess = null;
return reject(err);
}

backupGameProcess = null;
return resolve(JSON.parse(stdout) as LudusaviBackup);
}
);
Expand Down
13 changes: 0 additions & 13 deletions src/renderer/src/components/badge/badge.css.ts

This file was deleted.

11 changes: 11 additions & 0 deletions src/renderer/src/components/badge/badge.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
@use "../../scss/globals.scss";

.badge {
color: globals.$muted-color;
font-size: 10px;
padding: calc(globals.$spacing-unit / 2) globals.$spacing-unit;
border: solid 1px globals.$border-color;
border-radius: 4px;
display: flex;
align-items: center;
}
5 changes: 3 additions & 2 deletions src/renderer/src/components/badge/badge.tsx
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
import React from "react";
import * as styles from "./badge.css";

import "./badge.scss";

export interface BadgeProps {
children: React.ReactNode;
}

export function Badge({ children }: BadgeProps) {
return (
<div className={styles.badge}>
<div className="badge">
<span>{children}</span>
</div>
);
Expand Down
25 changes: 0 additions & 25 deletions src/renderer/src/components/bottom-panel/bottom-panel.css.ts

This file was deleted.

24 changes: 24 additions & 0 deletions src/renderer/src/components/bottom-panel/bottom-panel.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
@use "../../scss/globals.scss";

.bottom-panel {
width: "100%";
border-top: solid 1px globals.$border-color;
background-color: globals.$background-color;
padding: calc(globals.$spacing-unit / 2) calc(globals.$spacing-unit * 2);
display: flex;
align-items: center;
transition: all ease 0.2s;
justify-content: space-between;
position: relative;
z-index: globals.$bottom-panel-z-index;

&__downloads-button {
color: globals.$body-color;
border-bottom: solid 1px transparent;

&:hover {
border-bottom: solid 1px globals.$body-color;
cursor: pointer;
}
}
}
6 changes: 3 additions & 3 deletions src/renderer/src/components/bottom-panel/bottom-panel.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { useTranslation } from "react-i18next";

import { useDownload, useUserDetails } from "@renderer/hooks";

import * as styles from "./bottom-panel.css";
import "./bottom-panel.scss";

import { useNavigate } from "react-router-dom";
import { VERSION_CODENAME } from "@renderer/constants";
Expand Down Expand Up @@ -72,10 +72,10 @@ export function BottomPanel() {
]);

return (
<footer className={styles.bottomPanel}>
<footer className="bottom-panel">
<button
type="button"
className={styles.downloadsButton}
className="bottom-panel__downloads-button"
onClick={() => navigate("/downloads")}
>
<small>{status}</small>
Expand Down
4 changes: 0 additions & 4 deletions src/renderer/src/main.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,6 @@ import { Provider } from "react-redux";
import LanguageDetector from "i18next-browser-languagedetector";
import { HashRouter, Route, Routes } from "react-router-dom";

import * as Sentry from "@sentry/electron/renderer";

import "@fontsource/noto-sans/400.css";
import "@fontsource/noto-sans/500.css";
import "@fontsource/noto-sans/700.css";
Expand Down Expand Up @@ -37,8 +35,6 @@ const Achievements = React.lazy(
() => import("./pages/achievements/achievements")
);

Sentry.init({});

i18n
.use(LanguageDetector)
.use(initReactI18next)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -83,8 +83,10 @@ export function CloudSyncModal({ visible, onClose }: CloudSyncModalProps) {
};

useEffect(() => {
getGameBackupPreview();
}, [getGameBackupPreview]);
if (visible) {
getGameBackupPreview();
}
}, [getGameBackupPreview, visible]);

const backupStateLabel = useMemo(() => {
if (uploadingBackup) {
Expand Down
6 changes: 6 additions & 0 deletions src/renderer/src/scss/globals.scss
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,9 @@ $disabled-opacity: 0.5;
$active-opacity: 0.7;

$spacing-unit: 8px;

$toast-z-index: 5;
$bottom-panel-z-index: 3;
$title-bar-z-index: 4;
$backdrop-z-index: 4;
$modal-z-index: 5;
Loading

0 comments on commit 8af29ab

Please sign in to comment.