Skip to content

fix: support SetNativeDescription on iOS, macOS, and Android via attribute promotion - #219

Open
bobbyg603 wants to merge 1 commit into
mainfrom
fix/native-description-rebased
Open

fix: support SetNativeDescription on iOS, macOS, and Android via attribute promotion#219
bobbyg603 wants to merge 1 commit into
mainfrom
fix/native-description-rebased

Conversation

@bobbyg603

Copy link
Copy Markdown
Member

Closes #139. Replaces #146, which cannot be merged — see below.

Why this PR exists

#146 was branched off feat/windows-native-crash-reporting while #123 was still open. #123 was squash-merged, so main now holds all of that work as a single commit (f6adbf4) with no shared history with #146's branch. The merge base between #146 and main is therefore a commit from before #123 landed, and #146's diff against main shows 57 files — all of #123 replayed, plus its own change.

That is not merely cosmetic. A test merge of #146 into main fails:

CONFLICT (rename/rename): Samples~/my-unity-crasher/Scripts/ErrorGenerator.cs.meta renamed to
Editor/WerRegistration.cs.meta in HEAD and to
Samples~/my-unity-crasher/Scripts/CrashScenarios.cs.meta in origin/fix/native-description-all-platforms

and the content conflicts would revert #126's sample work#146's branch predates it, so its copy of CrashScenarios.cs still carries the old KNOWN GAP: appears in Player.log but produces no report text and would overwrite what is now on main.

This branch is the same commit (1509206) cherry-picked onto main, so the diff is only the change itself.

What it does

SetNativeDescription was Windows-only (BugSplat_SetUserDescription); on iOS, macOS, and Android it fell through to the nativeCrashReportingEnabled guard and did nothing, so bugsplat.Description = ... never reached native crash reports on those platforms.

It now sets the reserved attribute BugSplatDescription through the same per-platform interop the sibling setters already use — _setNativeAttributeIos / _setNativeAttributeMac on Apple, BugSplatBridge.setAttribute on Android. The backend promotes that attribute into the report's description field. Windows is unchanged.

Note

Backend dependency. The promotion ships in BugSplat-Git/src-backend#617 (fixes BugSplat-Git/src-backend#616). Until that deploys, the value still arrives with the crash report — it just shows as a plain visible attribute named BugSplatDescription instead of populating the description field. Harmless, and not silent data loss; once the backend deploys, promotion applies with no client change. Merge order does not matter; deploy order does.

Verification

dotnet build of Runtime/** + Tests/Runtime/** against Unity 6000.5.6f1 assemblies, compiled once per platform define so every branch of the touched #if chain was actually built: UNITY_IOS, UNITY_STANDALONE_OSX, UNITY_ANDROID, UNITY_STANDALONE_WIN0 errors each, plus the no-defines editor case.

Not verified: no Unity run, and no crash reported from a real device on any of the three newly-wired platforms. That is deferred to the release smoke test (#200), which covers Description on iOS, macOS, and Android.

🤖 Generated with Claude Code

…ibute promotion

The BugSplat backend promotes an attribute named BugSplatDescription to
the report's description field, so platforms without a dedicated native
description API route through the same attribute interop the sibling
setters use: the bugsplat-apple attribute call on iOS and macOS, and
BugSplatBridge.setAttribute on Android. The Windows path is unchanged.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

This PR extends BugSplat.SetNativeDescription so that description values reach native crash reports on iOS, macOS, and Android by setting the reserved BugSplatDescription attribute via existing per-platform interop (Windows behavior remains unchanged).

Changes:

  • Updated SetNativeDescription to call _setNativeAttributeIos/_setNativeAttributeMac with BugSplatDescription on Apple platforms.
  • Updated SetNativeDescription to call BugSplatBridge.setAttribute("BugSplatDescription", ...) on Android.
  • Updated the XML doc comment to remove the “Windows only” claim.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread Runtime/BugSplat.cs
Comment on lines +655 to +656
var javaClass = new AndroidJavaClass("com.bugsplat.android.BugSplatBridge");
javaClass.CallStatic("setAttribute", "BugSplatDescription", description);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

SetNativeDescription is a no-op everywhere except Windows

3 participants