Amplitude-TypeScript icon indicating copy to clipboard operation
Amplitude-TypeScript copied to clipboard

@amplitude/plugin-session-replay-browser v 1.11.3 does not call shutdown()

Open GxDesign opened this issue 7 months ago • 1 comments

Expected Behavior

Calling sessionReplay.shutdown() should stop recording

Current Behavior

When running in debug mode, calling shutdown() logged the shutdown action in v1.9.4 (my previous version) and stopped the recording. In v1.11.3, nothing gets logged and the recording continues. I am using the segment wrapper.

Using the latest wrapper and session-replay-browser breaks shutdown functionality, reverting to wrapper version 0.1.0 and session-replay-browser v1.9.4 works.

Possible Solution

Steps to Reproduce

  1. install @amplitude/plugin-session-replay-browser v1.11.3, and @amplitude/segment-session-replay-wrapper v0.3.1 (both latest)
  2. Im using @segment/analytics-next v1.72.1 (latest)
const segment = new AnalyticsBrowser()
// 3. call action to load segment
const initSegment = () => segment.load({ writeKey: API_KEY })
// 4. call action to initialize SR wrapper, pass instance, API key etc
const initSRWrapper = () => setupAmpSRSegmentWrapper({  segmentInstance: segment, ... })
// 5. call action to shut down recording
const shutdownSR = () => sessionReplay.shutdown()


## Environment
- JS SDK Version: versions listed above
- Installation Method: Yarn
- Browser and Version: Chrome 126

GxDesign avatar Jul 25 '24 04:07 GxDesign