From 873e991cc3d152b6d5319bc5e7f6d897c665e450 Mon Sep 17 00:00:00 2001 From: Frederik Bolding Date: Thu, 28 Aug 2025 15:39:09 +0200 Subject: [PATCH] fix: Reduce from error to warning for message when failing to terminate --- .../src/services/AbstractExecutionService.ts | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/packages/snaps-controllers/src/services/AbstractExecutionService.ts b/packages/snaps-controllers/src/services/AbstractExecutionService.ts index 9902b19db0..1b6f823747 100644 --- a/packages/snaps-controllers/src/services/AbstractExecutionService.ts +++ b/packages/snaps-controllers/src/services/AbstractExecutionService.ts @@ -4,7 +4,7 @@ import ObjectMultiplex from '@metamask/object-multiplex'; import type { BasePostMessageStream } from '@metamask/post-message-stream'; import { JsonRpcError } from '@metamask/rpc-errors'; import type { SnapRpcHookArgs } from '@metamask/snaps-utils'; -import { SNAP_STREAM_NAMES, logError } from '@metamask/snaps-utils'; +import { SNAP_STREAM_NAMES, logError, logWarning } from '@metamask/snaps-utils'; import type { Json, JsonRpcNotification, @@ -180,12 +180,7 @@ export abstract class AbstractExecutionService ); if (result === hasTimedOut || result !== 'OK') { - // We tried to shutdown gracefully but failed. This probably means the Snap is in infinite loop and - // hogging down the whole JS process. - // TODO(ritave): It might be doing weird things such as posting a lot of setTimeouts. Add a test to ensure that this behaviour - // doesn't leak into other workers. Especially important in IframeExecutionEnvironment since they all share the same - // JS process. - logError(`Snap "${snapId}" failed to terminate gracefully.`, result); + logWarning(`Snap "${snapId}" failed to terminate gracefully.`); } } catch { // Ignore