From a12f3fcd47d6374789468d0ad8413fdae4af81c8 Mon Sep 17 00:00:00 2001 From: Alexander Onnikov Date: Mon, 6 Oct 2025 16:12:17 +0700 Subject: [PATCH] qfix: log window reload reason Signed-off-by: Alexander Onnikov --- dev/prod/src/platform.ts | 1 + packages/presentation/src/configuration.ts | 1 + plugins/login-resources/src/components/Auth.svelte | 1 + .../src/components/socialIds/SocialIdRow.svelte | 2 +- plugins/workbench-resources/src/connect.ts | 9 +++++++++ 5 files changed, 13 insertions(+), 1 deletion(-) diff --git a/dev/prod/src/platform.ts b/dev/prod/src/platform.ts index 8022d41ce21..b331cfa0e6e 100644 --- a/dev/prod/src/platform.ts +++ b/dev/prod/src/platform.ts @@ -387,6 +387,7 @@ export async function configurePlatform() { if (err.message.includes('Loading chunk') && i != 4) { continue } + console.log('reload due to loading error') location.reload() } } diff --git a/packages/presentation/src/configuration.ts b/packages/presentation/src/configuration.ts index 5f74edcda21..eb9fde031d5 100644 --- a/packages/presentation/src/configuration.ts +++ b/packages/presentation/src/configuration.ts @@ -62,6 +62,7 @@ addTxListener((txes: Tx[]) => { if (cud.objectClass === core.class.PluginConfiguration) { if (cud.operations.enabled !== undefined) { // Plugin enabled/disabled we need to refresh + console.log('reload due to changed plugin configuration') location.reload() } } diff --git a/plugins/login-resources/src/components/Auth.svelte b/plugins/login-resources/src/components/Auth.svelte index 2cf33b07731..94b46b40ed7 100644 --- a/plugins/login-resources/src/components/Auth.svelte +++ b/plugins/login-resources/src/components/Auth.svelte @@ -107,6 +107,7 @@ time={status.params.notBefore * 1000} showHours={true} on:timeout={() => { + console.log('reload due to token inactive') window.location.reload() }} /> diff --git a/plugins/setting-resources/src/components/socialIds/SocialIdRow.svelte b/plugins/setting-resources/src/components/socialIds/SocialIdRow.svelte index 737c33ee73f..9e335d615ae 100644 --- a/plugins/setting-resources/src/components/socialIds/SocialIdRow.svelte +++ b/plugins/setting-resources/src/components/socialIds/SocialIdRow.svelte @@ -99,7 +99,7 @@ dangerous: true, action: async () => { await doRelease() - + console.log('reload due to primary social id release') location.reload() } }) diff --git a/plugins/workbench-resources/src/connect.ts b/plugins/workbench-resources/src/connect.ts index a24b39bd70a..a29785e5422 100644 --- a/plugins/workbench-resources/src/connect.ts +++ b/plugins/workbench-resources/src/connect.ts @@ -243,6 +243,7 @@ export async function connect (title: string): Promise { localStorage.setItem(`versionUpgrade:s${serverVersion}:f${frontVersion}`, 't') // It might have been refreshed manually and download has started - do not reload if (!isUpgrading) { + console.log('reload due to version upgrade') location.reload() } @@ -255,6 +256,7 @@ export async function connect (title: string): Promise { // It might be possible that this callback will fire after the user has spent some time // in the upgrade !modal! dialog and clicked upgrade - check again and do not reload if (get(upgradeDownloadProgress) < 0) { + console.log('reload due to upgrade download') location.reload() } }, 10000) @@ -268,6 +270,7 @@ export async function connect (title: string): Promise { return true }, onUpgrade: () => { + console.log('reload due to upgrade') location.reload() }, onUnauthorized: () => { @@ -292,6 +295,7 @@ export async function connect (title: string): Promise { translateCB(plugin.string.WorkspaceIsMigrating, {}, get(themeStore).language, (r) => { versionError.set(r) setTimeout(() => { + console.log('reload due to migration') location.reload() }, 5000) }) @@ -326,6 +330,7 @@ export async function connect (title: string): Promise { } if (event === ClientConnectEvent.Upgraded) { + console.log('reload due to upgrade') window.location.reload() } @@ -344,6 +349,7 @@ export async function connect (title: string): Promise { if (currentVersionStr !== reconnectVersionStr) { // It seems upgrade happened + console.log('reload due to version mismatch') location.reload() versionError.set(`${currentVersionStr} != ${reconnectVersionStr}`) } @@ -357,6 +363,7 @@ export async function connect (title: string): Promise { if (reconnectVersionStr !== '' && currentVersionStr !== reconnectVersionStr) { if (typeof sessionStorage !== 'undefined') { if (sessionStorage.getItem(versionStorageKey) !== reconnectVersionStr) { + console.log('reload due to version mismatch') sessionStorage.setItem(versionStorageKey, reconnectVersionStr) location.reload() } @@ -370,10 +377,12 @@ export async function connect (title: string): Promise { try { const frontConfig = await loadServerConfig(concatLink(frontUrl, '/config.json')) if (frontConfig?.version !== undefined && frontConfig.version !== currentFrontVersion) { + console.log('reload due to config version mismatch') location.reload() } } catch (err: any) { // Failed to load server config, reload location + console.log('reload due to config loading error') location.reload() } }