mirror of
https://github.com/lensapp/lens.git
synced 2025-05-20 05:10:56 +00:00
Bump all @sentry related packages
Signed-off-by: Sebastian Malton <sebastian@malton.name>
This commit is contained in:
1 parent
3a26ea7b7f
commit
797c6487bf
5 files changed
+95
-111
No files matched your search
@@ -4,7 +4,6 @@
|
||||
*/
|
||||
|
||||
import { Dedupe, Offline } from "@sentry/integrations";
|
||||
import * as Sentry from "@sentry/electron";
|
||||
import { sentryDsn, isProduction } from "./vars";
|
||||
import { UserStore } from "./user-store";
|
||||
import { inspect } from "util";
|
||||
@@ -23,10 +22,14 @@ function mapProcessName(processType: string) {
|
||||
/**
|
||||
* Initialize Sentry for the current process so to send errors for debugging.
|
||||
*/
|
||||
export function SentryInit() {
|
||||
export async function SentryInit() {
|
||||
const processName = mapProcessName(process.type);
|
||||
|
||||
Sentry.init({
|
||||
const { init } = process.type === "browser"
|
||||
? await import("@sentry/electron/main")
|
||||
: await import("@sentry/electron/renderer");
|
||||
|
||||
init({
|
||||
beforeSend: (event) => {
|
||||
// default to false, in case instance of UserStore is not created (yet)
|
||||
const allowErrorReporting = UserStore.getInstance(false)?.allowErrorReporting ?? false;
|
||||
|
||||
+11
-9
@@ -60,21 +60,23 @@ import navigateToPreferencesInjectable from "../common/front-end-routing/routes/
|
||||
import syncGeneralCatalogEntitiesInjectable from "./catalog-sources/sync-general-catalog-entities.injectable";
|
||||
import hotbarStoreInjectable from "../common/hotbar-store.injectable";
|
||||
import applicationMenuItemsInjectable from "./menu/application-menu-items.injectable";
|
||||
import type { DiContainer } from "@ogre-tools/injectable";
|
||||
|
||||
const di = getDi();
|
||||
async function main(di: DiContainer) {
|
||||
app.setName(appName);
|
||||
|
||||
app.setName(appName);
|
||||
|
||||
app.on("ready", async () => {
|
||||
/**
|
||||
* Note: this MUST be called before electron's "ready" event has been emitted.
|
||||
*/
|
||||
await SentryInit();
|
||||
await di.runSetups();
|
||||
await app.whenReady();
|
||||
|
||||
injectSystemCAs();
|
||||
|
||||
const onCloseCleanup = disposer();
|
||||
const onQuitCleanup = disposer();
|
||||
|
||||
SentryInit();
|
||||
|
||||
logger.info(`📟 Setting ${productName} as protocol client for lens://`);
|
||||
|
||||
if (app.setAsDefaultProtocolClient("lens")) {
|
||||
@@ -187,8 +189,6 @@ app.on("ready", async () => {
|
||||
lensProtocolRouterMain.route(rawUrl);
|
||||
});
|
||||
|
||||
logger.debug("[APP-MAIN] waiting for 'ready' and other messages");
|
||||
|
||||
const directoryForExes = di.inject(directoryForExesInjectable);
|
||||
|
||||
logger.info(`🚀 Starting ${productName} from "${directoryForExes}"`);
|
||||
@@ -357,7 +357,9 @@ app.on("ready", async () => {
|
||||
setTimeout(() => {
|
||||
appEventBus.emit({ name: "service", action: "start" });
|
||||
}, 1000);
|
||||
});
|
||||
}
|
||||
|
||||
main(getDi());
|
||||
|
||||
/**
|
||||
* Exports for virtual package "@k8slens/extensions" for main-process.
|
||||
|
||||
@@ -44,10 +44,6 @@ import { bindEvents } from "./navigation/events";
|
||||
import deleteClusterDialogModelInjectable
|
||||
from "./components/delete-cluster-dialog/delete-cluster-dialog-model/delete-cluster-dialog-model.injectable";
|
||||
|
||||
if (process.isMainFrame) {
|
||||
SentryInit();
|
||||
}
|
||||
|
||||
configurePackages(); // global packages
|
||||
registerCustomThemes(); // monaco editor themes
|
||||
|
||||
@@ -63,6 +59,9 @@ async function attachChromeDebugger() {
|
||||
}
|
||||
|
||||
export async function bootstrap(di: DiContainer) {
|
||||
if (process.isMainFrame) {
|
||||
await SentryInit();
|
||||
}
|
||||
await di.runSetups();
|
||||
|
||||
// TODO: Consolidate import time side-effect to setup time
|
||||
|
||||
Reference in new issue
Block a user