From 96bf1c5c909022b1da98593a98c90541dbfab45e Mon Sep 17 00:00:00 2001 From: Paul Berberian Date: Tue, 3 Sep 2024 19:14:09 +0200 Subject: [PATCH] Fix issue when reloading while a reload is pending. I noticed of an issue with the `MULTI_THREAD` feature, where an application would receive a `CancellationError` in the very rare (possible right now?) occurrence where we're reloading while a reload operation is already pending. We don't ever want to leak `CancellationError` which is just an internal mechanism. I thought that we can just ignore that one. --- src/core/main/worker/worker_main.ts | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/core/main/worker/worker_main.ts b/src/core/main/worker/worker_main.ts index 62dafe20b6..42563e28c8 100644 --- a/src/core/main/worker/worker_main.ts +++ b/src/core/main/worker/worker_main.ts @@ -884,6 +884,10 @@ function loadOrReloadPreparedContent( ); }, (err: unknown) => { + if (TaskCanceller.isCancellationError(err)) { + log.info("WP: A reloading operation was cancelled"); + return; + } sendMessage({ type: WorkerMessageType.Error, contentId,