Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion modules/sentry-cocoa
Submodule sentry-cocoa updated 148 files
5 changes: 0 additions & 5 deletions samples/Sentry.Samples.Maui/MauiProgram.cs
Original file line number Diff line number Diff line change
Expand Up @@ -62,11 +62,6 @@ public static MauiApp CreateMauiApp()
// sentry:SessionReplay.Mask="Unmask" attribute to individual controls instead.
options.Native.ExperimentalOptions.SessionReplay.UnmaskControlsOfType<Button>();
#endif
#if __IOS__ || __MACCATALYST__
// SDK users must explicitly opt-in to Session Replay in unreliable environments - when running liquid
// glass on iOS 26.0 or later
options.Native.ExperimentalOptions.SessionReplay.EnableSessionReplayInUnreliableEnvironment = true;
#endif
#endif

options.SetBeforeScreenshotCapture((@event, hint) =>
Expand Down
32 changes: 24 additions & 8 deletions src/Sentry.Bindings.Cocoa/ApiDefinitions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2029,6 +2029,10 @@ interface SentryOptions
[Static]
[Export("defaultEnvironment")]
string DefaultEnvironment { get; }

// @property (nonatomic) BOOL enableMetrics;
[Export("enableMetrics")]
bool EnableMetrics { get; set; }
}

// @interface SentryClient : NSObject
Expand Down Expand Up @@ -2173,18 +2177,14 @@ interface SentryExperimentalOptions
[Export("enableUnhandledCPPExceptionsV2")]
bool EnableUnhandledCPPExceptionsV2 { get; set; }

// @property (nonatomic) BOOL enableSessionReplayInUnreliableEnvironment;
[Export("enableSessionReplayInUnreliableEnvironment")]
bool EnableSessionReplayInUnreliableEnvironment { get; set; }
Comment thread
cursor[bot] marked this conversation as resolved.

// @property (nonatomic) BOOL enableMetrics;
[Export("enableMetrics")]
bool EnableMetrics { get; set; }

// @property (nonatomic) BOOL enableWatchdogTerminationsV2;
[Export("enableWatchdogTerminationsV2")]
bool EnableWatchdogTerminationsV2 { get; set; }

// @property (nonatomic) BOOL enableReplayNetworkDetailsCapturing;
[Export("enableReplayNetworkDetailsCapturing")]
bool EnableReplayNetworkDetailsCapturing { get; set; }

// -(void)validateOptions:(NSDictionary<NSString *,id> * _Nullable)options;
[Export("validateOptions:")]
void ValidateOptions([NullAllowed] NSDictionary<NSString, NSObject> options);
Expand Down Expand Up @@ -2600,6 +2600,18 @@ interface SentryReplayOptions : SentryRedactOptions
[Export("enableFastViewRendering")]
bool EnableFastViewRendering { get; set; }

// @property (nonatomic) BOOL networkCaptureBodies;
[Export("networkCaptureBodies")]
bool NetworkCaptureBodies { get; set; }

// @property (copy, nonatomic) NSArray<NSString *> * _Nonnull networkRequestHeaders;
[Export("networkRequestHeaders", ArgumentSemantic.Copy)]
string[] NetworkRequestHeaders { get; set; }

// @property (copy, nonatomic) NSArray<NSString *> * _Nonnull networkResponseHeaders;
[Export("networkResponseHeaders", ArgumentSemantic.Copy)]
string[] NetworkResponseHeaders { get; set; }

// @property (readonly, nonatomic) NSInteger replayBitRate;
[Export("replayBitRate")]
nint ReplayBitRate { get; }
Expand All @@ -2624,6 +2636,10 @@ interface SentryReplayOptions : SentryRedactOptions
[Export("maximumDuration")]
double MaximumDuration { get; set; }

// -(BOOL)isNetworkDetailCaptureEnabledFor:(NSString * _Nonnull)urlString __attribute__((warn_unused_result("")));
[Export("isNetworkDetailCaptureEnabledFor:")]
bool IsNetworkDetailCaptureEnabledFor(string urlString);

// -(instancetype _Nonnull)initWithDictionary:(NSDictionary<NSString *,id> * _Nonnull)dictionary;
[Export("initWithDictionary:")]
NativeHandle Constructor(NSDictionary<NSString, NSObject> dictionary);
Expand Down
3 changes: 2 additions & 1 deletion src/Sentry.Bindings.Cocoa/StructsAndEnums.cs
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,8 @@ internal enum SentryExtensionType : long
Widget = 0,
Intent = 1,
Action = 2,
Share = 3
Share = 3,
NotificationService = 4
}

[Native]
Expand Down
32 changes: 0 additions & 32 deletions src/Sentry/Platforms/Cocoa/SentryOptions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -283,39 +283,7 @@
/// Session Replay options for the native Sentry Cocoa SDK.
/// </summary>
public class NativeSentryReplayOptions
{

Check failure on line 286 in src/Sentry/Platforms/Cocoa/SentryOptions.cs

View check run for this annotation

@sentry/warden / warden: code-review

Removal of EnableSessionReplayInUnreliableEnvironment is a breaking API change without migration path

The public property `EnableSessionReplayInUnreliableEnvironment` is being removed from `NativeSentryReplayOptions` without any deprecation cycle or migration path. Any consumer code that sets this property will fail to compile after upgrading. Per the skill's backwards compatibility criteria, breaking API changes should have a migration path (e.g., mark obsolete first, or document the migration in release notes/XML docs).

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Removal of EnableSessionReplayInUnreliableEnvironment is a breaking API change without migration path

The public property EnableSessionReplayInUnreliableEnvironment is being removed from NativeSentryReplayOptions without any deprecation cycle or migration path. Any consumer code that sets this property will fail to compile after upgrading. Per the skill's backwards compatibility criteria, breaking API changes should have a migration path (e.g., mark obsolete first, or document the migration in release notes/XML docs).

Verification

Reviewed the hunk showing the deletion of the public property EnableSessionReplayInUnreliableEnvironment on the public nested class NativeSentryReplayOptions within the public SentryOptions type. The PR description notes the underlying Cocoa SDK now runs Session Replay on iOS 26 by default, which explains the removal, but the .NET binding still exposes this as a public API surface and removing it directly breaks the API contract for any consumer who previously set this flag.

Identified by Warden code-review · VZF-ABE

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

I think this is fine, since that functionality is clearly marked as experimental.

/// <summary>
/// <para>
/// Forces enabling of session replay in unreliable environments.
/// </para>
/// <para>
/// Due to internal changes with the release of Liquid Glass on iOS 26.0, the masking of text and images can
/// not be reliably guaranteed. Therefore the SDK uses a defensive programming approach to disable the
/// session replay integration by default, unless the environment is detected as reliable.
/// </para>
/// <para>
/// Indicators for reliable environments include:
/// <list type="bullet">
/// <item>
/// <description>Running on an older version of iOS that doesn't have Liquid Glass (iOS 18 or earlier)</description>
/// </item>
/// <item>
/// <description><c>UIDesignRequiresCompatibility</c> is explicitly set to <c>YES</c> in <c>Info.plist</c></description>
/// </item>
/// <item>
/// <description>The app was built with Xcode &lt; 26.0 (DTXcode &lt; 2600)</description>
/// </item>
/// </list>
/// </para>
/// <para>
/// Important: This flag allows to re-enable the session replay integration on iOS 26.0 and later, but please be aware that text and images may not be masked as expected.
/// </para>
/// </summary>
/// <remarks>
/// See https://github.com/getsentry/sentry-cocoa/issues/6389
/// </remarks>
public bool EnableSessionReplayInUnreliableEnvironment { get; set; } = false;

/// <summary>
/// The sample rate for sessions that had an error or crash.
/// Value must be between 0.0 and 1.0.
Expand Down
4 changes: 0 additions & 4 deletions src/Sentry/Platforms/Cocoa/SentrySdk.cs
Original file line number Diff line number Diff line change
Expand Up @@ -152,10 +152,6 @@ private static void InitSentryCocoaSdk(SentryOptions options)
options.AutoSessionTracking = false;
nativeOptions.EnableAutoSessionTracking = true;

// SDK users must explicitly opt-in to Session Replay in unreliable environments
nativeOptions.Experimental.EnableSessionReplayInUnreliableEnvironment =
options.Native.ExperimentalOptions.SessionReplay.EnableSessionReplayInUnreliableEnvironment;

var sessionSampleRate = (float)(options.Native.ExperimentalOptions.SessionReplay.SessionSampleRate ?? 0f);
var onErrorSampleRate = (float)(options.Native.ExperimentalOptions.SessionReplay.OnErrorSampleRate ?? 0f);
var cocoaReplayOptions = new Sentry.CocoaSdk.SentryReplayOptions();
Expand Down
Loading