Skip to content

ref: Remove enableSessionReplayInUnreliableEnvironment use#6046

Open
itaybre wants to merge 2 commits intomainfrom
chore/remove_enableSessionReplayInUnreliableEnvironment
Open

ref: Remove enableSessionReplayInUnreliableEnvironment use#6046
itaybre wants to merge 2 commits intomainfrom
chore/remove_enableSessionReplayInUnreliableEnvironment

Conversation

@itaybre
Copy link
Copy Markdown
Contributor

@itaybre itaybre commented Apr 24, 2026

📢 Type of change

  • Bugfix
  • New feature
  • Enhancement
  • Refactoring

📜 Description

Remove enableSessionReplayInUnreliableEnvironment use

💡 Motivation and Context

Session Replay on iOS 26 was fixed on v9.10 so we don't need this anymore

💚 How did you test it?

📝 Checklist

  • I added tests to verify changes
  • No new PII added or SDK only sends newly added PII if sendDefaultPII is enabled
  • I updated the docs if needed.
  • I updated the wizard if needed.
  • All tests passing
  • No breaking changes

🔮 Next steps

@itaybre itaybre added the ready-to-merge Triggers the full CI test suite label Apr 24, 2026
@sentry
Copy link
Copy Markdown

sentry Bot commented Apr 24, 2026

📲 Install Builds

Android

🔗 App Name App ID Version Configuration
Sentry RN io.sentry.reactnative.sample 8.9.1 (84) Release

⚙️ sentry-react-native Build Distribution Settings

@itaybre itaybre marked this pull request as ready for review April 24, 2026 14:47
Copy link
Copy Markdown

@cursor cursor Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit 4badb9d. Configure here.

Comment thread packages/core/ios/SentrySDKWrapper.m
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Apr 24, 2026

iOS (legacy) Performance metrics 🚀

  Plain With Sentry Diff
Startup time 1220.23 ms 1219.52 ms -0.71 ms
Size 3.38 MiB 4.77 MiB 1.39 MiB

Baseline results on branch: main

Startup times

Revision Plain With Sentry Diff
7ac3378+dirty 1213.37 ms 1218.15 ms 4.78 ms
4b87b12+dirty 1212.90 ms 1222.09 ms 9.19 ms
890d145+dirty 1223.59 ms 1231.37 ms 7.78 ms
0d9949d+dirty 1211.38 ms 1219.67 ms 8.29 ms
04207c4+dirty 1191.27 ms 1189.78 ms -1.48 ms
3ce5254+dirty 1219.93 ms 1221.90 ms 1.96 ms
4953e94+dirty 1212.06 ms 1214.83 ms 2.77 ms
2c735cc+dirty 1229.67 ms 1221.50 ms -8.17 ms
a50b33d+dirty 1197.74 ms 1197.17 ms -0.57 ms
df5d108+dirty 1225.90 ms 1220.14 ms -5.76 ms

App size

Revision Plain With Sentry Diff
7ac3378+dirty 3.38 MiB 4.76 MiB 1.38 MiB
4b87b12+dirty 3.38 MiB 4.77 MiB 1.39 MiB
890d145+dirty 3.38 MiB 4.77 MiB 1.38 MiB
0d9949d+dirty 3.38 MiB 4.76 MiB 1.38 MiB
04207c4+dirty 3.38 MiB 4.76 MiB 1.38 MiB
3ce5254+dirty 3.38 MiB 4.76 MiB 1.38 MiB
4953e94+dirty 3.38 MiB 4.73 MiB 1.35 MiB
2c735cc+dirty 3.38 MiB 4.74 MiB 1.35 MiB
a50b33d+dirty 3.38 MiB 4.73 MiB 1.35 MiB
df5d108+dirty 3.38 MiB 4.73 MiB 1.35 MiB

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Apr 24, 2026

iOS (new) Performance metrics 🚀

  Plain With Sentry Diff
Startup time 1225.83 ms 1223.87 ms -1.96 ms
Size 3.38 MiB 4.77 MiB 1.39 MiB

Baseline results on branch: main

Startup times

Revision Plain With Sentry Diff
7ac3378+dirty 1202.35 ms 1198.31 ms -4.04 ms
4b87b12+dirty 1199.49 ms 1199.78 ms 0.29 ms
890d145+dirty 1212.98 ms 1220.10 ms 7.12 ms
0d9949d+dirty 1203.94 ms 1202.27 ms -1.67 ms
04207c4+dirty 1228.55 ms 1226.04 ms -2.51 ms
3ce5254+dirty 1217.70 ms 1224.69 ms 6.99 ms
4953e94+dirty 1217.41 ms 1223.53 ms 6.12 ms
2c735cc+dirty 1223.33 ms 1224.38 ms 1.04 ms
a50b33d+dirty 1207.11 ms 1212.10 ms 5.00 ms
df5d108+dirty 1207.34 ms 1210.50 ms 3.16 ms

App size

Revision Plain With Sentry Diff
7ac3378+dirty 3.38 MiB 4.76 MiB 1.38 MiB
4b87b12+dirty 3.38 MiB 4.77 MiB 1.39 MiB
890d145+dirty 3.38 MiB 4.77 MiB 1.38 MiB
0d9949d+dirty 3.38 MiB 4.76 MiB 1.38 MiB
04207c4+dirty 3.38 MiB 4.76 MiB 1.38 MiB
3ce5254+dirty 3.38 MiB 4.76 MiB 1.38 MiB
4953e94+dirty 3.38 MiB 4.73 MiB 1.35 MiB
2c735cc+dirty 3.38 MiB 4.74 MiB 1.35 MiB
a50b33d+dirty 3.38 MiB 4.73 MiB 1.35 MiB
df5d108+dirty 3.38 MiB 4.73 MiB 1.35 MiB

Comment on lines 127 to 135
}

+ (void)setupWithDictionary:(NSDictionary *_Nonnull)options
isSessionReplayEnabled:(BOOL)isSessionReplayEnabled
error:(NSError *_Nonnull *_Nonnull)errorPointer
{
SentryOptions *sentryOptions = [self createOptionsWithDictionary:options
isSessionReplayEnabled:isSessionReplayEnabled
error:errorPointer];
if (!options) {
return;
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Bug: The nil-check in setupWithDictionary incorrectly validates the input options instead of the sentryOptions object, potentially causing startWithOptions to be called with nil.
Severity: HIGH

Suggested Fix

Modify the conditional check from if (!options) to if (!sentryOptions) to ensure the SentryOptions object was successfully created before it is used to initialize the SDK.

Prompt for AI Agent
Review the code at the location below. A potential bug has been identified by an AI
agent. Verify if this is a real issue. If it is, propose a fix; if not, explain why it's
not valid.

Location: packages/core/ios/SentrySDKWrapper.m#L127-L135

Potential issue: In the `setupWithDictionary` method, `createOptionsWithDictionary` can
return `nil` if initialization fails, for example, due to an invalid DSN. The code then
incorrectly checks if the input `options` dictionary is `nil` instead of checking the
returned `sentryOptions` object. Consequently, if `sentryOptions` is `nil`, the program
proceeds to call `[SentrySDKWrapper startWithOptions:nil]`, which can lead to a crash or
undefined behavior during SDK initialization.

Did we get this right? 👍 / 👎 to inform future reviews.

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

Labels

ready-to-merge Triggers the full CI test suite

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant