Mobile Replay: `beforeXyz` options
- Dominant language
- Python
- Stars
- 44.8k
- Forks
- 4.9k
- Avg merge
- 22h 21m
- Merged PRs (30d)
- 586
Description
This issue is to discuss/track, which `beforeXyz` options we want to add to Mobile SDKs for Session Replay (if any).
## Background
We currently provide a few `beforeXyz` options that users can use to adapt specific behaviours. From the [docs](https://docs.sentry.io/platforms/javascript/session-replay/configuration/):
- `beforeAddRecordingEvent`: Filter additional recording events that include console logs and network requests/responses.
- `beforeErrorSampling`: Filter error events which should be skipped for error sampling. Return false if error sampling should be skipped for this error event, or true to sample for this error. Will only be called in buffer mode.
For Mobile, we identified a few options we think might be valuable to add to support more varied use cases. Note that none of these are implemented and no alignment on naming, signature, etc. has happened until now:
- `onRenderedScreenshot`: called after taking, before masking screenshot; e.g. remove screenshot, write to disk for debugging, add timestamp ([draft PR](https://github.com/getsentry/sentry-cocoa/pull/4974) we use for debugging)
- `onMaskedScreenshot`: called after masking screenshot; e.g. remove screenshot, write to disk for debugging ([draft PR](https://github.com/getsentry/sentry-cocoa/pull/4974) we use for debugging)
- `onEncodedVideoSegment`: called after a video segment has been generated from previously taken frames (could solve the request of https://github.com/getsentry/sentry-cocoa/issues/4835)
- `beforeCaptureSessionReplay`: called before Replay is captured; e.g. don't capture Replays for specific users, screens, feature flags, app states (requested by user in https://github.com/getsentry/sentry-cocoa/issues/4834)
- `beforeSendSessionReplay`: called before Replay is sent; e.g. remove replay that's too long/short, don't send for specific user (requested by user in https://github.com/getsentry/sentry-cocoa/issues/4834)
Contributor guide
Research direction
No implementation files, tests, or entry points are identified. Start by reviewing the linked Session Replay configuration docs and the sentry-cocoa draft PR, then follow the linked requests and compare the proposed Mobile SDK callbacks. The issue is not complete until the options, naming, signatures, and scope are agreed.
Written by the indexing model from the issue text.
Assessment
- Domain
- mobile-dev
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100