mirror of
https://github.com/lensapp/lens.git
synced 2025-05-20 05:10:56 +00:00
Fix not starting with sentryDSN configured (#5629)
* Fix not starting with sentryDSN configured - Make sure that all beforeElectronIsReady runables are run completely syncronously - Fix when setupSentry is to be run (namely before electron is ready) Signed-off-by: Sebastian Malton <sebastian@malton.name> * Fix tests Signed-off-by: Sebastian Malton <sebastian@malton.name>
This commit is contained in:
parent
125277fd81
commit
f45627f117
@ -15,9 +15,7 @@ const di = getDi();
|
||||
|
||||
const startApplication = di.inject(startMainApplicationInjectable);
|
||||
|
||||
(async () => {
|
||||
await startApplication();
|
||||
})();
|
||||
void startApplication();
|
||||
|
||||
/**
|
||||
* Exports for virtual package "@k8slens/extensions" for main-process.
|
||||
|
||||
@ -5,7 +5,7 @@
|
||||
import { getInjectable } from "@ogre-tools/injectable";
|
||||
import { initializeSentryReporting } from "../../../common/sentry";
|
||||
import { init } from "@sentry/electron/main";
|
||||
import { beforeApplicationIsLoadingInjectionToken } from "../runnable-tokens/before-application-is-loading-injection-token";
|
||||
import { beforeElectronIsReadyInjectionToken } from "../runnable-tokens/before-electron-is-ready-injection-token";
|
||||
|
||||
const setupSentryInjectable = getInjectable({
|
||||
id: "setup-sentry",
|
||||
@ -18,7 +18,7 @@ const setupSentryInjectable = getInjectable({
|
||||
|
||||
causesSideEffects: true,
|
||||
|
||||
injectionToken: beforeApplicationIsLoadingInjectionToken,
|
||||
injectionToken: beforeElectronIsReadyInjectionToken,
|
||||
});
|
||||
|
||||
export default setupSentryInjectable;
|
||||
|
||||
@ -38,11 +38,12 @@ const startMainApplicationInjectable = getInjectable({
|
||||
const onLoadOfApplication = runMany(onLoadOfApplicationInjectionToken);
|
||||
const afterApplicationIsLoaded = runMany(afterApplicationIsLoadedInjectionToken);
|
||||
|
||||
return async () => {
|
||||
return () => {
|
||||
// Stuff happening before application is ready needs to be synchronous because of
|
||||
// https://github.com/electron/electron/issues/21370
|
||||
beforeElectronIsReady();
|
||||
|
||||
return (async () => {
|
||||
await waitForElectronToBeReady();
|
||||
|
||||
await beforeApplicationIsLoading();
|
||||
@ -66,6 +67,7 @@ const startMainApplicationInjectable = getInjectable({
|
||||
}
|
||||
|
||||
await afterApplicationIsLoaded();
|
||||
})();
|
||||
};
|
||||
},
|
||||
});
|
||||
|
||||
Loading…
Reference in New Issue
Block a user