Skip to content

Replay manual start doesn't trigger recording #6605

Description

@earlAchromatic

Is there an existing issue for this?

How do you use Sentry?

Sentry Saas (sentry.io)

Which package are you using?

@sentry/vue

SDK Version

7.25

Framework Version

Vue 2.7.14

Link to Sentry event

No response

Steps to Reproduce

Initialize Sentry without Replay following the Replay docs:

Sentry.init({
dsn: config.sentryDsn
replaysOnErrorSampleRate: 1.0,
integrations: [],
})
// initialize Replay outside of integrations
const replay = new Sentry.Replay()
replay.start() // no recording triggered on error

Expected Result

Expected recording to be triggered on error and show up in the UI. This doesn't happen.

Actual Result

No recording is sent to UI. This is because _setup is not called when Replay is initialized outside of the integrations array. _setup is responsible for initializing a ReplayContainer instance which is required to actually start a recording. The result is when Replay.start is called and Replay has been initialized outside of the Sentry config, no recording every takes place. I am able to manually start recording by doing this though:

const replay = new Sentry.Replay()
replay.setupOnce() // this method must be called to manually set up before starting.
replay.start()

I do not believe this the intended behavior. Or maybe this is intentional and the docs just need updated?

It looks like this could be fixed by calling setupOnce inside of Replay.start when it is called if a _setupComplete flag has not been previously set.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions