Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Option to disable session replay after SDK has been started #4833

Open
aellett opened this issue Feb 11, 2025 · 2 comments
Open

Option to disable session replay after SDK has been started #4833

aellett opened this issue Feb 11, 2025 · 2 comments

Comments

@aellett
Copy link

aellett commented Feb 11, 2025

Problem Statement

I'm doing some experimentation with session replay, and I'd like to be able to completely turn off session replay in the middle of a session, when certain events happen. Couple of examples where I'm thinking this would be useful:

  • If requirements say that a user can opt out of any recording, and then they do that during a session, it should take effect immediately.
  • If a certain feature shouldn't be captured at all by session replay, I want to turn off replay if a user visits that feature.

I looked around a bit for how I might turn off replay in cases like this, but I didn't find anything. I see that I can stop/pause a replay that is in progress, which is close to what I'm looking for. However, I don't want to worry about toggling replay on/off after I do it once, I just want to be sure that it's off completely. Also, I think it'd probably be ambiguous about what to expect with the replay that had already started. Would it be sent still?

Solution Brainstorm

I wonder if this would be as simple as setting a new sampling value (of zero). I would think that the difficulty there is that you might already have a replay in progress. I think I'd want to blow that away entirely in addition to not capturing any further replays. My preference would be to just make a call to the SDK that stops future recordings and trashes in-progress recordings.

Are you willing to submit a PR?

No response

@kahest
Copy link
Member

kahest commented Feb 11, 2025

@aellett thanks for writing in - this makes sense.

I think you're referring to the existing start/stop API from this PR which indeed only stops the current replay.

@philprime do you know if there's a way to deactivate SR after SDK init?

@aellett
Copy link
Author

aellett commented Feb 11, 2025

@kahest yeah, that's what I was thinking of. Looking closer at it (that PR you referenced) though, it looks to me like start will add the session replay integration to the SDK if it wasn't originally added, but stop does exactly what you said: pause the current replay and then nil it out. If I'm reading that right, it seems like I would've expected those two calls to be opposite but equal, but they seem subtly different.

Before I looked at that PR, I was guessing that if I called start without having an existing integration, that it would've effectively been a nop, but I don't think that's true.

@philprime philprime self-assigned this Feb 12, 2025
@philprime philprime moved this from Needs Discussion to Needs Investigation in Mobile & Cross Platform SDK Feb 12, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: Needs Investigation
Development

No branches or pull requests

3 participants