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

Flush saves the recorded session even if the sample rate is zero

Open vctormb opened this issue 8 months ago • 4 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/nextjs

SDK Version

8.10.0

Framework Version

No response

Link to Sentry event

No response

SDK Setup

const client = SentrySDK.getClient()
const options = client.getOptions()
       
options.replaysSessionSampleRate = 0
options.replaysOnErrorSampleRate = 1.0
         
const replay = SentrySDK.replayIntegration({
 minReplayDuration: 3000,
})

client.addIntegration(replay)

Steps to Reproduce

  1. Initialize Replay with replaysSessionSampleRate = 0 and replaysOnErrorSampleRate = 1.0
  2. Call Sentry.getReplay().flush()and it will upload a new video recording even if replaysSessionSampleRate is 0

Expected Result

It should not record a video when calling flush if replaysSessionSampleRate = 0

Actual Result

It is recording a video when calling flush when replaysSessionSampleRate = 0.

vctormb avatar Jun 26 '24 17:06 vctormb