-
-
Couldn't load subscription status.
- Fork 369
fix: Disable SessionSentryReplayIntegration if the environment is unsafe #6539
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
Instructions and example for changelogPlease add an entry to Example: ## Unreleased
### Fixes
- Disable SessionSentryReplayIntegration if the environment is unsafe ([#6539](https://github.com/getsentry/sentry-cocoa/pull/6539))If none of the above apply, you can opt out of this check by adding |
❌ 3 Tests Failed:
View the top 3 failed test(s) by shortest run time
To view more test analytics, go to the Test Analytics Dashboard |
| @objc public static let processInfoWrapper: SentryProcessInfoSource = ProcessInfo.processInfo | ||
| static let infoPlistWrapper: SentryInfoPlistWrapperProvider = SentryInfoPlistWrapper() | ||
| @objc public static let sessionReplayEnvironmentChecker: SentrySessionReplayEnvironmentChecker = { | ||
| @objc public static var sessionReplayEnvironmentChecker: SentrySessionReplayEnvironmentCheckerProvider = { |
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.
Only a let is thread safe. If you need it to override the value for testing I think it's better to pass the dependencies as a parameter to the class you're testing, rather than having it used from here.
Or if that's too hard to refactor just move it to SentryDependencyContainer and use the lock with a lazy var
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 only for testing.
Moving this to SentryDependencyContainer won't work on the v8 branch, which also needs this fix
Performance metrics 🚀
|
| Revision | Plain | With Sentry | Diff |
|---|---|---|---|
| db9572a | 1200.27 ms | 1234.80 ms | 34.53 ms |
| 5258fb8 | 1207.92 ms | 1234.51 ms | 26.59 ms |
| 2481950 | 1221.04 ms | 1248.98 ms | 27.94 ms |
| 2be5991 | 1228.55 ms | 1264.65 ms | 36.10 ms |
| 7d88965 | 1228.86 ms | 1248.53 ms | 19.67 ms |
| ab0ba7e | 1216.08 ms | 1242.40 ms | 26.31 ms |
| 139db8b | 1231.50 ms | 1258.19 ms | 26.69 ms |
| 78af7a9 | 1225.75 ms | 1256.98 ms | 31.23 ms |
| 5db87fa | 1218.88 ms | 1251.53 ms | 32.65 ms |
| b5a7583 | 1238.22 ms | 1263.94 ms | 25.71 ms |
App size
| Revision | Plain | With Sentry | Diff |
|---|---|---|---|
| db9572a | 23.75 KiB | 858.69 KiB | 834.93 KiB |
| 5258fb8 | 23.75 KiB | 874.45 KiB | 850.70 KiB |
| 2481950 | 23.74 KiB | 872.74 KiB | 849.00 KiB |
| 2be5991 | 23.75 KiB | 994.73 KiB | 970.98 KiB |
| 7d88965 | 23.75 KiB | 994.72 KiB | 970.98 KiB |
| ab0ba7e | 23.75 KiB | 904.54 KiB | 880.79 KiB |
| 139db8b | 23.75 KiB | 920.64 KiB | 896.89 KiB |
| 78af7a9 | 23.75 KiB | 990.00 KiB | 966.26 KiB |
| 5db87fa | 23.75 KiB | 926.65 KiB | 902.90 KiB |
| b5a7583 | 23.75 KiB | 913.44 KiB | 889.68 KiB |
This PR disable the SessionReplayIntegration instead of disabling SentrySessionReplay to avoid running any SessionReplay logic if not needed.