fix: various fixes to things + simply app proxy sentry setup

This commit is contained in:
Hampus Kraft
2026-02-19 00:29:58 +00:00
parent ff1d15f7aa
commit 528e4e0d7f
44 changed files with 441 additions and 1042 deletions

View File

@@ -70,8 +70,6 @@ const logger = new Logger('index');
preloadClientInfo();
const normalizePathSegment = (value: string): string => value.replace(/^\/+|\/+$/g, '');
async function resumePendingDesktopHandoffLogin(): Promise<void> {
const electronApi = getElectronAPI();
if (!electronApi || typeof electronApi.consumeDesktopHandoffCode !== 'function') {
@@ -103,7 +101,7 @@ async function resumePendingDesktopHandoffLogin(): Promise<void> {
}
function initSentry(): void {
const resolvedSentryDsn = buildRuntimeSentryDsn() || RuntimeConfigStore.sentryDsn;
const resolvedSentryDsn = RuntimeConfigStore.sentryDsn;
const normalizedBuildSha =
Config.PUBLIC_BUILD_SHA && Config.PUBLIC_BUILD_SHA !== 'dev' ? Config.PUBLIC_BUILD_SHA : undefined;
const buildNumberString =
@@ -167,24 +165,6 @@ function initSentry(): void {
});
}
function buildRuntimeSentryDsn(): string | null {
if (!RuntimeConfigStore.sentryProjectId || !RuntimeConfigStore.sentryPublicKey) {
return null;
}
const origin = window.location.origin;
if (!origin) {
return null;
}
const proxyPath = normalizePathSegment(RuntimeConfigStore.sentryProxyPath ?? '/error-reporting-proxy');
const projectSegment = normalizePathSegment(RuntimeConfigStore.sentryProjectId);
const url = new URL(`/${proxyPath}/${projectSegment}`, origin);
url.username = RuntimeConfigStore.sentryPublicKey;
return url.toString();
}
async function bootstrap(): Promise<void> {
await initI18n();