Skip to content
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

fix: hide StackTraceMode from options to avoid accidental errors when used with IL2CPP #1033

Merged
merged 2 commits into from
Oct 24, 2022
Merged
Show file tree
Hide file tree
Changes from 1 commit
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 Directory.Build.targets
Original file line number Diff line number Diff line change
Expand Up @@ -396,7 +396,7 @@ Log.LogMessage("Unity Version: " + version);
</Task>
</UsingTask>

<!-- Locate the TestRunner.dlls by filling the wildcard with the template version number. 3d is the default template -->
<!-- Locate the TestRunner.dlls by filling the wildcard with the template version number. 3d is the default template -->
<UsingTask TaskName="LocateTestRunner" TaskFactory="RoslynCodeTaskFactory" AssemblyFile="$(MSBuildToolsPath)\Microsoft.Build.Tasks.Core.dll">
<ParameterGroup>
<UnityLibcache ParameterType="System.String" Required="true" />
Expand Down
8 changes: 6 additions & 2 deletions src/Sentry.Unity/SentryUnityOptions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,9 @@ public sealed class SentryUnityOptions : SentryOptions
/// </remarks>
public bool Il2CppLineNumberSupportEnabled { get; set; } = true;

/// This option is hidden due to incompatibility between IL2CPP and Enhanced mode.
private new StackTraceMode StackTraceMode { get; set; }

// Initialized by native SDK binding code to set the User.ID in .NET (UnityEventProcessor).
internal string? _defaultUserId;
internal string? DefaultUserId
Expand Down Expand Up @@ -175,8 +178,9 @@ internal SentryUnityOptions(SentryMonoBehaviour behaviour, IApplication applicat
RequestBodyCompressionLevel = CompressionLevelWithAuto.NoCompression;
InitCacheFlushTimeout = System.TimeSpan.Zero;

// Ben.Demystifer not compatible with IL2CPP
StackTraceMode = StackTraceMode.Original;
// Ben.Demystifer not compatible with IL2CPP. We could allow Enhanced in the future for Mono.
// See https://github.com/getsentry/sentry-unity/issues/675
base.StackTraceMode = StackTraceMode.Original;
IsEnvironmentUser = false;

if (application.ProductName is string productName
Expand Down
1 change: 0 additions & 1 deletion test/Sentry.Unity.Tests/SentryUnityTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ public void AsyncStackTrace()
{
var options = new SentryUnityOptions();
options.AttachStacktrace = true;
options.StackTraceMode = StackTraceMode.Original;
var sut = new SentryStackTraceFactory(options);

IList<SentryStackFrame> framesSentry = null!;
Expand Down