sentry-javascript icon indicating copy to clipboard operation
sentry-javascript copied to clipboard

Replays from user feedback not including 30s before the widget is opened

Open rodolfoBee opened this issue 7 months ago • 2 comments

Is there an existing issue for this?

  • [x] I have checked for existing issues https://github.com/getsentry/sentry-javascript/issues
  • [x] I have reviewed the documentation https://docs.sentry.io/
  • [x] I am using the latest SDK release https://github.com/getsentry/sentry-javascript/releases

How do you use Sentry?

Sentry Saas (sentry.io)

Which SDK are you using?

@sentry/react

SDK Version

9.28.0

Framework Version

No response

Link to Sentry event

https://dev-curumas.sentry.io/explore/replays/84e1fccb2d8a4dbcb912f611a2c973c6/?referrer=%2Fissues%2Ffeedback%2F&t=0&t_main=breadcrumbs

Reproduction Example/SDK Setup

Sentry.init({
  dsn: "__MY_DSN__",
  integrations: [
    Sentry.reactRouterV5BrowserTracingIntegration({ history, heartbeatInterval:8000 }),
    Sentry.replayIntegration({
      maskAllText: false,
      _experiments:{
        recordCrossOriginIframes: true
      }
    }),
    Sentry.feedbackIntegration({
      // Additional SDK configuration goes in here, for example:
      colorScheme: "system",
      includeReplay: true
    }),
  ],
  replaysOnErrorSampleRate: 1.0,
  sendDefaultPii: true,
  });

Steps to Reproduce

  1. Open the page with the feedback widget.
  2. Do something on the page for 30s or more
  3. Open the widget.
  4. Wait for some time before sending the feedback

Expected Result

The replay will contain 30s before the feedback widget is opened as mentioned here:

First, make sure that the Session Replay integration is configured correctly and that replaysOnErrorSampleRate is greater than 0. When this is done, the Replay SDK will buffer up to 30 seconds of the user's session until the user opens the User Feedback widget.

Actual Result

The replays start with the widget already opened. https://dev-curumas.sentry.io/explore/replays/84e1fccb2d8a4dbcb912f611a2c973c6/?referrer=%2Fissues%2Ffeedback%2F&t=0&t_main=breadcrumbs

More examples were reported by a user in this internal ticket.

rodolfoBee avatar Jun 11 '25 07:06 rodolfoBee

Hey, I forwarded this to the Replay team on Linear (cc @billyvg @chargome)

Lms24 avatar Jun 11 '25 09:06 Lms24

@chargome let's promote our experimental flag to production

@rbisol can you pass on to the user they can turn on _experiments.autoFlushOnFeedback e.g.

replayIntegration({
  _experiments: {
    autoFlushOnFeedback: true,
  }
});

billyvg avatar Jun 11 '25 13:06 billyvg

closed by https://github.com/getsentry/sentry-javascript/pull/17220

chargome avatar Sep 17 '25 09:09 chargome