From 10355bae425b19ef83b7876507837c15595668dd Mon Sep 17 00:00:00 2001 From: Mark Yen Date: Tue, 16 Jul 2024 14:07:09 -0700 Subject: [PATCH 1/2] background: Don't trigger settings update actions at shutdown When we're shutting down, don't trigger the follow-up actions from writing to settings. This avoids an issue where we attempt to update path management on shutdown, and end up doing half a write that clobbers the user's .bashrc (etc.) files because that is asynchronous. Signed-off-by: Mark Yen --- background.ts | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/background.ts b/background.ts index 5840658e4bf..3de305f7daf 100644 --- a/background.ts +++ b/background.ts @@ -143,6 +143,12 @@ mainEvents.on('settings-update', async(newSettings) => { } k8smanager.debug = runInDebugMode; + if (gone) { + console.debug('Suppressing settings-update because app is quitting'); + + return; + } + await setPathManager(newSettings.application.pathManagementStrategy); await pathManager.enforce(); From b8a285464ecf0197d8c2c1ace7901144f10dc3a5 Mon Sep 17 00:00:00 2001 From: Mark Yen Date: Tue, 16 Jul 2024 14:08:00 -0700 Subject: [PATCH 2/2] Logging: Use ISO timestamps in logs This makes the timestamps in log files easier to parse for tools (where we previously used human-oriented system locale instead). Signed-off-by: Mark Yen --- pkg/rancher-desktop/utils/logging.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/rancher-desktop/utils/logging.ts b/pkg/rancher-desktop/utils/logging.ts index d8f24c78373..8c369e331ac 100644 --- a/pkg/rancher-desktop/utils/logging.ts +++ b/pkg/rancher-desktop/utils/logging.ts @@ -158,7 +158,7 @@ export class Log { } protected logWithDate(method: consoleKey, message: any, optionalParameters: any[]) { - this.console[method](`%s: ${ message }`, new Date(), ...optionalParameters); + this.console[method](`%s: ${ message }`, new Date().toISOString(), ...optionalParameters); } async sync() {