Skip to content

fix: default PostExceptionsInEditor to false - #202

Open
bobbyg603 wants to merge 1 commit into
mainfrom
fix/post-exceptions-in-editor-default
Open

fix: default PostExceptionsInEditor to false#202
bobbyg603 wants to merge 1 commit into
mainfrom
fix/post-exceptions-in-editor-default

Conversation

@bobbyg603

Copy link
Copy Markdown
Member

Closes #153

BugSplatOptions.PostExceptionsInEditor defaulted to true, and so did both client settings repositories. Every play mode NullReferenceException a developer hit while iterating was uploaded to the same database that collects reports from shipped players, so crash counts - and anything built on top of them - mixed developer noise with production signal.

Which option, and why

Issue #153 offers two fixes: default to false, or keep posting and auto-tag editor reports with a filterable attribute. This PR defaults to false. The tag approach still uploads and stores every play mode exception: the customer pays for the storage, the reports still count against their data, and every dashboard, saved search, and alert has to learn to exclude the tag. Defaulting off costs the one audience that wants editor reports - somebody verifying their integration - a single checkbox, and that person is already in the inspector.

What changed

  • Runtime/Client/BugSplatOptions.cs - PostExceptionsInEditor no longer initializes to true
  • Runtime/Settings/DotNetStandardClientSettingsRepository.cs and Runtime/Settings/WebGLClientSettingsRepository.cs - default false, so a code-constructed BugSplat and one built from an options asset agree

Only PostExceptionsInEditor is touched, so this stays mergeable alongside #154, which is fixing the same class of disagreement for CapturePlayerLog.

Breaking change

Editor exceptions are no longer uploaded unless the setting is enabled. This is a deliberate behavior change for 5.0.0.

  • Options assets that already exist keep whatever value Unity serialized for them (PostExceptionsInEditor: 1 stays 1), so only newly created assets pick up the new default. The my-unity-crasher sample asset already stores 1 and keeps working unchanged.
  • A BugSplat constructed in code - new BugSplat(...) or BugSplat.CreateFromOptions with the field left alone - now skips editor exceptions. Anyone relying on editor reports sets bugsplat.PostExceptionsInEditor = true or checks the box on the options asset.

Tests

  • CreateFromOptions_ShouldCopyEveryConfiguredValue now sets PostExceptionsInEditor = true, keeping every value in that test away from its default so the assertion still proves the mapping exists
  • CreateFromOptions_WhenPostExceptionsInEditorNotSet_ShouldNotPostExceptionsInEditor pins the options asset default
  • NewBugSplat_ShouldNotPostExceptionsInEditor pins the code-constructed default, so the two paths can't drift apart again
  • Five ReportUploadGuardServiceTests cases that relied on the old default now set the flag explicitly. They run in the editor, where the guard otherwise short-circuits before ShouldPostException is consulted; two of them (...ShouldPostExceptionTrue_ShouldReturnTrue, ShouldPostLogMessage_WhenLogTypeException_ShouldReturnTrue) would have failed outright, and the rest would have passed for the wrong reason

Docs

README's options table now states the default, and the Configuration section tells you how to turn editor posting on while verifying an integration.

Verification

Runtime/** plus Tests/Runtime/** compile clean against Unity 6000.5.6f1 assemblies via a standalone dotnet build (Build succeeded, 0 errors; the 2 warnings are pre-existing CS0649s in BugSplat.cs). The Unity test runner was not executed - no Unity editor run was possible in this environment - so the new and edited tests are verified to compile but have not been run.

馃 Generated with Claude Code

PostExceptionsInEditor defaulted to true in BugSplatOptions and in both
client settings repositories, so every play mode NullReferenceException a
developer hit while iterating was uploaded to the same database that
collects reports from shipped players. Crash counts, and anything built on
top of them, mixed developer noise with production signal, and a customer
only stopped it by noticing the setting.

Default it to false everywhere. Posting from the editor is now opt in, and
the one case that wants it - verifying an integration - is a deliberate act
one checkbox away. The alternative offered in #153, auto tagging editor
reports with a filterable attribute, still uploads and stores every play
mode exception and leaves the customer filtering noise they never asked
for.

The options asset and both settings repositories move together so a code
constructed BugSplat and one built from an options asset agree. Options
assets that already exist keep the value they serialized, so only newly
created assets and code constructed clients see the new default; the
my-unity-crasher sample asset already stores true and keeps working.

Guard service tests that leaned on the old default now set the flag
explicitly - they run in the editor, where the guard otherwise short
circuits before ShouldPostException is consulted.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Copilot AI lite review requested due to automatic review settings August 11, 2026 21:17

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 changes the default behavior of BugSplatOptions.PostExceptionsInEditor (and the corresponding client-settings repositories) so editor/play mode exceptions are not uploaded by default, preventing developer iteration crashes from polluting production crash metrics.

Changes:

  • Default PostExceptionsInEditor to false in BugSplatOptions (newly created options assets) and in both client settings repositories (code-constructed clients).
  • Update/extend runtime tests to pin the new defaults and keep mapping coverage in CreateFromOptions.
  • Update README documentation to reflect the new default and how to enable editor exception posting when desired.

Reviewed changes

Copilot reviewed 6 out of 6 changed files in this pull request and generated no comments.

Show a summary per file
File Description
Tests/Runtime/Reporter/ReportUploadGuardServiceTests.cs Updates tests to explicitly enable editor posting where required for guard behavior under Application.isEditor.
Tests/Runtime/BugSplatCreateFromOptionsTests.cs Adds/adjusts tests to pin default false and verify CreateFromOptions mapping for PostExceptionsInEditor.
Runtime/Settings/WebGLClientSettingsRepository.cs Changes repository default PostExceptionsInEditor to false for code-constructed settings.
Runtime/Settings/DotNetStandardClientSettingsRepository.cs Changes repository default PostExceptionsInEditor to false for code-constructed settings.
Runtime/Client/BugSplatOptions.cs Removes = true initializer so newly created options assets default to false, and updates tooltip.
README.md Documents the new default and instructions to enable editor exception uploading during integration verification.

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

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.

F5: PostExceptionsInEditor defaults to true and pollutes production databases

3 participants