-
Notifications
You must be signed in to change notification settings - Fork 66
feat: disable or enable session replay plugins based on remote config #452
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
base: main
Are you sure you want to change the base?
Conversation
| /// | ||
| /// // Token automatically unsubscribes when deallocated | ||
| /// ``` | ||
| final class MulticastCallback<T> { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is a generalized pattern already used in the codebase. Did not refactor existing code to keep the scope small for this PR, but will do with a future PR
| if let isEnabled = capturePerformanceValue as? Bool { | ||
| return isEnabled | ||
| } | ||
| // When enabled, capturePerformance is an object (we ignore the keys for now) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
which configs are within the capturePerformance config?
|
|
||
| if let index = installedIndex, !isEnabled { | ||
| // Installed, but disabled in remote | ||
| installedPlugins[index].stop() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we check that installedPlugins has the index (index) and the same for remove to avoid out-of-bounds issues?
| /// | ||
| /// // Token automatically unsubscribes when deallocated | ||
| /// ``` | ||
| final class MulticastCallback<T> { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should we call it PostHogMulticastCallback to avoid naming clashes with other things?
| let config = URLSessionConfiguration.default | ||
|
|
||
| #if DEBUG | ||
| config.requestCachePolicy = .reloadIgnoringLocalCacheData |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
whats that used for?
marandaneto
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
left a few comments but LGTM
the project settings FE would require a few changes since this is now supported on the ios sdk now, and most likely indirectly for rn ios and flutter ios
💡 Motivation and Context
Closes #351
Adds the ability to enable/disable session replay plugins via PostHog project settings.
The current configs options affected are
sessionReplayConfig.captureLogs(key sessionRecording.consoleLogRecordingEnabled)sessionReplayConfig.captureNetworkTelemetry(key capturePerformance)Local config takes precedence. A plugin must first be enabled locally before remote config is evaluated.
Limitations / Future work
config.remoteConfig = true./flags?config=trueresponse as a fallback whenconfig.remoteConfig = false💚 How did you test it?
📝 Checklist