From d79bbf2c1008bd2df2afa19ef3d0df40c59b4baa Mon Sep 17 00:00:00 2001 From: Billy Vong Date: Thu, 31 Oct 2024 16:19:43 +0100 Subject: [PATCH] fix(rrweb): Do not re-initialize worker in CanvasManager.reset (#221) `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() {