Skip to content

Manual replays are longer than recording #13791

@rodolfoBee

Description

@rodolfoBee

Is there an existing issue for this?

How do you use Sentry?

Sentry Saas (sentry.io)

Which SDK are you using?

@sentry/react

SDK Version

8.31.0 and 7.119.0

Framework Version

React 17.0.0

Link to Sentry event

No response

Reproduction Example/SDK Setup

import * as Sentry from '@sentry/react'

Sentry.init({
  dsn: "__MY_DSN_",
  integrations: [
    Sentry.replayIntegration({
      maskAllText: false,
    }),
  ],
  replaysSessionSampleRate: 0.0,  
  replaysOnErrorSampleRate: 0.0,
  debug:true,
  });

class StartReplay extends React.Component{
  render(){
    return(
      <button onClick={() => {
        const replay = Sentry.getReplay();
        replay.flush()
        replay.start()
        console.log("Starting the replay")
      }}>START REPLAY</button>  
    )
  }
}

class StopReplay extends React.Component{
  render(){
    return(
      <button onClick={() => {
        const replay = Sentry.getReplay();
        console.log("Stopping the replay")
        replay.stop()
      }}>STOP REPLAY</button>  
    )
  }
}

ReactDOM.render([
    <StartReplay/>,
    <StopReplay/>,
  ], document.getElementById('root'));

Steps to Reproduce

  1. run the simple app above, it has 2 buttons: one to start a replay and one to stop the replay
  2. leave the page open for a while, you can move the mouse and click around.
  3. start the replay
  4. again move the mouse and do clicks
  5. stop the replay

Expected Result

The replay in sentry only has the movements from after the replay was started

Actual Result

The replay in sentry has a a period at the start when nothing is shown in the replay. Then it shows the "start replay" click and all the movements as expected until the replay is stopped.

There are no request sent to sentry before the replay starts, I could not identify why the Sentry UI is showing the freezed paged for such a long time before the actual start of the replay. Sample replays can be found in my organisation:
https://dev-curumas.sentry.io/replays/?project=5278835

Metadata

Metadata

Assignees

No one assigned

    Labels

    BugPackage: reactIssues related to the Sentry React SDKPackage: replayIssues related to the Sentry Replay SDK

    Projects

    Status

    No status

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions