fix: removing sentry

This commit is contained in:
Chubby Granny Chaser 2024-11-02 17:06:30 +00:00
parent 74cd60ff3d
commit 8af29abd92
No known key found for this signature in database
24 changed files with 72 additions and 1163 deletions

View File

@ -1,5 +1,4 @@
MAIN_VITE_API_URL=API_URL MAIN_VITE_API_URL=API_URL
MAIN_VITE_AUTH_URL=AUTH_URL MAIN_VITE_AUTH_URL=AUTH_URL
MAIN_VITE_STEAMGRIDDB_API_KEY=YOUR_API_KEY MAIN_VITE_STEAMGRIDDB_API_KEY=YOUR_API_KEY
MAIN_VITE_SENTRY_DSN=YOUR_SENTRY_DSN
SENTRY_AUTH_TOKEN=

View File

@ -43,8 +43,6 @@ jobs:
MAIN_VITE_API_URL: ${{ vars.MAIN_VITE_STAGING_API_URL }} MAIN_VITE_API_URL: ${{ vars.MAIN_VITE_STAGING_API_URL }}
MAIN_VITE_AUTH_URL: ${{ vars.MAIN_VITE_STAGING_AUTH_URL }} MAIN_VITE_AUTH_URL: ${{ vars.MAIN_VITE_STAGING_AUTH_URL }}
MAIN_VITE_CHECKOUT_URL: ${{ vars.MAIN_VITE_STAGING_CHECKOUT_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 }} GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Build Windows - name: Build Windows
@ -54,8 +52,6 @@ jobs:
MAIN_VITE_API_URL: ${{ vars.MAIN_VITE_STAGING_API_URL }} MAIN_VITE_API_URL: ${{ vars.MAIN_VITE_STAGING_API_URL }}
MAIN_VITE_AUTH_URL: ${{ vars.MAIN_VITE_STAGING_AUTH_URL }} MAIN_VITE_AUTH_URL: ${{ vars.MAIN_VITE_STAGING_AUTH_URL }}
MAIN_VITE_CHECKOUT_URL: ${{ vars.MAIN_VITE_STAGING_CHECKOUT_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 }} GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Create artifact - name: Create artifact

View File

@ -45,8 +45,6 @@ jobs:
MAIN_VITE_API_URL: ${{ vars.MAIN_VITE_API_URL }} MAIN_VITE_API_URL: ${{ vars.MAIN_VITE_API_URL }}
MAIN_VITE_AUTH_URL: ${{ vars.MAIN_VITE_AUTH_URL }} MAIN_VITE_AUTH_URL: ${{ vars.MAIN_VITE_AUTH_URL }}
MAIN_VITE_CHECKOUT_URL: ${{ vars.MAIN_VITE_CHECKOUT_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 }} GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Build Windows - name: Build Windows
@ -56,8 +54,6 @@ jobs:
MAIN_VITE_API_URL: ${{ vars.MAIN_VITE_API_URL }} MAIN_VITE_API_URL: ${{ vars.MAIN_VITE_API_URL }}
MAIN_VITE_AUTH_URL: ${{ vars.MAIN_VITE_AUTH_URL }} MAIN_VITE_AUTH_URL: ${{ vars.MAIN_VITE_AUTH_URL }}
MAIN_VITE_CHECKOUT_URL: ${{ vars.MAIN_VITE_CHECKOUT_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 }} GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Create artifact - name: Create artifact

1
.gitignore vendored
View File

@ -9,5 +9,4 @@ out
*.log* *.log*
.env .env
.vite .vite
sentry.properties
ludusavi/ ludusavi/

View File

@ -6,16 +6,9 @@ import {
externalizeDepsPlugin, externalizeDepsPlugin,
} from "electron-vite"; } from "electron-vite";
import react from "@vitejs/plugin-react"; import react from "@vitejs/plugin-react";
import { sentryVitePlugin } from "@sentry/vite-plugin";
import { vanillaExtractPlugin } from "@vanilla-extract/vite-plugin"; import { vanillaExtractPlugin } from "@vanilla-extract/vite-plugin";
import svgr from "vite-plugin-svgr"; 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 }) => { export default defineConfig(({ mode }) => {
loadEnv(mode); loadEnv(mode);
@ -35,7 +28,7 @@ export default defineConfig(({ mode }) => {
"@shared": resolve("src/shared"), "@shared": resolve("src/shared"),
}, },
}, },
plugins: [externalizeDepsPlugin(), swcPlugin(), sentryPlugin], plugins: [externalizeDepsPlugin(), swcPlugin()],
}, },
preload: { preload: {
plugins: [externalizeDepsPlugin()], plugins: [externalizeDepsPlugin()],
@ -51,7 +44,7 @@ export default defineConfig(({ mode }) => {
"@shared": resolve("src/shared"), "@shared": resolve("src/shared"),
}, },
}, },
plugins: [svgr(), react(), vanillaExtractPlugin(), sentryPlugin], plugins: [svgr(), react(), vanillaExtractPlugin()],
}, },
}; };
}); });

View File

@ -38,7 +38,6 @@
"@hookform/resolvers": "^3.9.0", "@hookform/resolvers": "^3.9.0",
"@primer/octicons-react": "^19.9.0", "@primer/octicons-react": "^19.9.0",
"@reduxjs/toolkit": "^2.2.3", "@reduxjs/toolkit": "^2.2.3",
"@sentry/electron": "^5.1.0",
"@vanilla-extract/css": "^1.14.2", "@vanilla-extract/css": "^1.14.2",
"@vanilla-extract/dynamic": "^2.1.1", "@vanilla-extract/dynamic": "^2.1.1",
"@vanilla-extract/recipes": "^0.5.2", "@vanilla-extract/recipes": "^0.5.2",
@ -83,7 +82,6 @@
"@electron-toolkit/eslint-config-prettier": "^2.0.0", "@electron-toolkit/eslint-config-prettier": "^2.0.0",
"@electron-toolkit/eslint-config-ts": "^1.0.1", "@electron-toolkit/eslint-config-ts": "^1.0.1",
"@electron-toolkit/tsconfig": "^1.0.1", "@electron-toolkit/tsconfig": "^1.0.1",
"@sentry/vite-plugin": "^2.20.1",
"@swc/core": "^1.4.16", "@swc/core": "^1.4.16",
"@types/auto-launch": "^5.0.5", "@types/auto-launch": "^5.0.5",
"@types/color": "^3.0.6", "@types/color": "^3.0.6",

5
sentry.properties Normal file
View File

@ -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

View File

@ -1,5 +1,4 @@
import jwt from "jsonwebtoken"; import jwt from "jsonwebtoken";
import * as Sentry from "@sentry/electron/main";
import { userAuthRepository } from "@main/repository"; import { userAuthRepository } from "@main/repository";
import { registerEvent } from "../register-event"; import { registerEvent } from "../register-event";
@ -10,8 +9,6 @@ const getSessionHash = async (_event: Electron.IpcMainInvokeEvent) => {
if (!auth) return null; if (!auth) return null;
const payload = jwt.decode(auth.accessToken) as jwt.JwtPayload; const payload = jwt.decode(auth.accessToken) as jwt.JwtPayload;
Sentry.setContext("sessionId", payload.sessionId);
return payload.sessionId; return payload.sessionId;
}; };

View File

@ -1,5 +1,4 @@
import { registerEvent } from "../register-event"; import { registerEvent } from "../register-event";
import * as Sentry from "@sentry/electron/main";
import { import {
DownloadManager, DownloadManager,
HydraApi, HydraApi,
@ -29,9 +28,6 @@ const signOut = async (_event: Electron.IpcMainInvokeEvent) => {
gamesPlaytime.clear(); gamesPlaytime.clear();
}); });
/* Removes user from Sentry */
Sentry.setUser(null);
/* Cancels any ongoing downloads */ /* Cancels any ongoing downloads */
DownloadManager.cancelDownload(); DownloadManager.cancelDownload();

View File

@ -1,5 +1,4 @@
import { app, BrowserWindow, net, protocol } from "electron"; import { app, BrowserWindow, net, protocol } from "electron";
import { init } from "@sentry/electron/main";
import updater from "electron-updater"; import updater from "electron-updater";
import i18n from "i18next"; import i18n from "i18next";
import path from "node:path"; import path from "node:path";
@ -26,12 +25,6 @@ autoUpdater.logger = logger;
const gotTheLock = app.requestSingleInstanceLock(); const gotTheLock = app.requestSingleInstanceLock();
if (!gotTheLock) app.quit(); 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"); app.commandLine.appendSwitch("--no-sandbox");
i18n.init({ i18n.init({

View File

@ -24,6 +24,7 @@ export class Ludusavi {
workerData: { workerData: {
binaryPath: this.binaryPath, binaryPath: this.binaryPath,
}, },
maxThreads: 1,
}); });
static async getConfig() { static async getConfig() {

View File

@ -4,7 +4,6 @@ import {
userAuthRepository, userAuthRepository,
userSubscriptionRepository, userSubscriptionRepository,
} from "@main/repository"; } from "@main/repository";
import * as Sentry from "@sentry/electron/main";
import { UserNotLoggedInError } from "@shared"; import { UserNotLoggedInError } from "@shared";
import { logger } from "../logger"; import { logger } from "../logger";
@ -39,8 +38,6 @@ export const getUserData = () => {
await userSubscriptionRepository.delete({ id: 1 }); await userSubscriptionRepository.delete({ id: 1 });
} }
Sentry.setUser({ id: me.id, username: me.username });
return me; return me;
}) })
.catch(async (err) => { .catch(async (err) => {

View File

@ -4,7 +4,6 @@ interface ImportMetaEnv {
readonly MAIN_VITE_STEAMGRIDDB_API_KEY: string; readonly MAIN_VITE_STEAMGRIDDB_API_KEY: string;
readonly MAIN_VITE_API_URL: string; readonly MAIN_VITE_API_URL: string;
readonly MAIN_VITE_AUTH_URL: string; readonly MAIN_VITE_AUTH_URL: string;
readonly MAIN_VITE_SENTRY_DSN: string;
readonly MAIN_VITE_CHECKOUT_URL: string; readonly MAIN_VITE_CHECKOUT_URL: string;
} }

View File

@ -5,8 +5,6 @@ import { workerData } from "node:worker_threads";
const { binaryPath } = workerData; const { binaryPath } = workerData;
let backupGameProcess: cp.ChildProcess | null = null;
export const backupGame = ({ export const backupGame = ({
title, title,
backupPath, backupPath,
@ -18,11 +16,6 @@ export const backupGame = ({
preview?: boolean; preview?: boolean;
winePrefix?: string; winePrefix?: string;
}) => { }) => {
if (backupGameProcess && !backupGameProcess.killed) {
backupGameProcess.kill();
backupGameProcess = null;
}
return new Promise((resolve, reject) => { return new Promise((resolve, reject) => {
const args = ["backup", title, "--api", "--force"]; const args = ["backup", title, "--api", "--force"];
@ -30,16 +23,14 @@ export const backupGame = ({
if (backupPath) args.push("--path", backupPath); if (backupPath) args.push("--path", backupPath);
if (winePrefix) args.push("--wine-prefix", winePrefix); if (winePrefix) args.push("--wine-prefix", winePrefix);
backupGameProcess = cp.execFile( cp.execFile(
binaryPath, binaryPath,
args, args,
(err: cp.ExecFileException | null, stdout: string) => { (err: cp.ExecFileException | null, stdout: string) => {
if (err) { if (err) {
backupGameProcess = null;
return reject(err); return reject(err);
} }
backupGameProcess = null;
return resolve(JSON.parse(stdout) as LudusaviBackup); return resolve(JSON.parse(stdout) as LudusaviBackup);
} }
); );

View File

@ -1,13 +0,0 @@
import { style } from "@vanilla-extract/css";
import { SPACING_UNIT } from "../../theme.css";
export const badge = style({
color: "#c0c1c7",
fontSize: "10px",
padding: `${SPACING_UNIT / 2}px ${SPACING_UNIT}px`,
border: "solid 1px #c0c1c7",
borderRadius: "4px",
display: "flex",
alignItems: "center",
});

View File

@ -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;
}

View File

@ -1,5 +1,6 @@
import React from "react"; import React from "react";
import * as styles from "./badge.css";
import "./badge.scss";
export interface BadgeProps { export interface BadgeProps {
children: React.ReactNode; children: React.ReactNode;
@ -7,7 +8,7 @@ export interface BadgeProps {
export function Badge({ children }: BadgeProps) { export function Badge({ children }: BadgeProps) {
return ( return (
<div className={styles.badge}> <div className="badge">
<span>{children}</span> <span>{children}</span>
</div> </div>
); );

View File

@ -1,25 +0,0 @@
import { style } from "@vanilla-extract/css";
import { SPACING_UNIT, vars } from "../../theme.css";
export const bottomPanel = style({
width: "100%",
borderTop: `solid 1px ${vars.color.border}`,
backgroundColor: vars.color.background,
padding: `${SPACING_UNIT / 2}px ${SPACING_UNIT * 2}px`,
display: "flex",
alignItems: "center",
transition: "all ease 0.2s",
justifyContent: "space-between",
position: "relative",
zIndex: vars.zIndex.bottomPanel,
});
export const downloadsButton = style({
color: vars.color.body,
borderBottom: "1px solid transparent",
":hover": {
borderBottom: `1px solid ${vars.color.body}`,
cursor: "pointer",
},
});

View File

@ -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;
}
}
}

View File

@ -3,7 +3,7 @@ import { useTranslation } from "react-i18next";
import { useDownload, useUserDetails } from "@renderer/hooks"; import { useDownload, useUserDetails } from "@renderer/hooks";
import * as styles from "./bottom-panel.css"; import "./bottom-panel.scss";
import { useNavigate } from "react-router-dom"; import { useNavigate } from "react-router-dom";
import { VERSION_CODENAME } from "@renderer/constants"; import { VERSION_CODENAME } from "@renderer/constants";
@ -72,10 +72,10 @@ export function BottomPanel() {
]); ]);
return ( return (
<footer className={styles.bottomPanel}> <footer className="bottom-panel">
<button <button
type="button" type="button"
className={styles.downloadsButton} className="bottom-panel__downloads-button"
onClick={() => navigate("/downloads")} onClick={() => navigate("/downloads")}
> >
<small>{status}</small> <small>{status}</small>

View File

@ -6,8 +6,6 @@ import { Provider } from "react-redux";
import LanguageDetector from "i18next-browser-languagedetector"; import LanguageDetector from "i18next-browser-languagedetector";
import { HashRouter, Route, Routes } from "react-router-dom"; 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/400.css";
import "@fontsource/noto-sans/500.css"; import "@fontsource/noto-sans/500.css";
import "@fontsource/noto-sans/700.css"; import "@fontsource/noto-sans/700.css";
@ -37,8 +35,6 @@ const Achievements = React.lazy(
() => import("./pages/achievements/achievements") () => import("./pages/achievements/achievements")
); );
Sentry.init({});
i18n i18n
.use(LanguageDetector) .use(LanguageDetector)
.use(initReactI18next) .use(initReactI18next)

View File

@ -83,8 +83,10 @@ export function CloudSyncModal({ visible, onClose }: CloudSyncModalProps) {
}; };
useEffect(() => { useEffect(() => {
getGameBackupPreview(); if (visible) {
}, [getGameBackupPreview]); getGameBackupPreview();
}
}, [getGameBackupPreview, visible]);
const backupStateLabel = useMemo(() => { const backupStateLabel = useMemo(() => {
if (uploadingBackup) { if (uploadingBackup) {

View File

@ -13,3 +13,9 @@ $disabled-opacity: 0.5;
$active-opacity: 0.7; $active-opacity: 0.7;
$spacing-unit: 8px; $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;

1075
yarn.lock

File diff suppressed because it is too large Load Diff