From 76bf9f659d123bf8f50c9cdec7838fe5de27a105 Mon Sep 17 00:00:00 2001 From: Billy Vong Date: Tue, 29 Oct 2024 17:24:57 -0400 Subject: [PATCH] fix(rrweb): Do not re-initialize worker in CanvasManager.reset `reset()` gets called when we stop a recording in progress. There is no reason to re-initialize the worker in `reset()` as you would need to call `record()` to start recording again, which would start a new worker. This was introduced in https://github.com/getsentry/rrweb/pull/168. --- .../rrweb/src/record/observers/canvas/canvas-manager.ts | 7 ------- 1 file changed, 7 deletions(-) diff --git a/packages/rrweb/src/record/observers/canvas/canvas-manager.ts b/packages/rrweb/src/record/observers/canvas/canvas-manager.ts index aa202e7636..836bae544f 100644 --- a/packages/rrweb/src/record/observers/canvas/canvas-manager.ts +++ b/packages/rrweb/src/record/observers/canvas/canvas-manager.ts @@ -123,13 +123,6 @@ export class CanvasManager implements CanvasManagerInterface { this.worker?.terminate(); this.worker = null; this.snapshotInProgressMap = new Map(); - if ( - (this.options.recordCanvas && - typeof this.options.sampling === 'number') || - this.options.enableManualSnapshot - ) { - this.worker = this.initFPSWorker(); - } } public freeze() {