Skip to content

Commit

Permalink
Merge pull request #696 from bugsnag/next
Browse files Browse the repository at this point in the history
Release v7.5.1
  • Loading branch information
richardelms authored Feb 9, 2023
2 parents 7459372 + 7ff09ae commit e2744cb
Show file tree
Hide file tree
Showing 25 changed files with 384 additions and 108 deletions.
14 changes: 14 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,19 @@
# Changelog

## 7.5.1 (2023-02-08)

### Dependency updates

- Update bugsnag-cocoa from v6.25.1 to [v6.25.2](https://github.com/bugsnag/bugsnag-cocoa/blob/master/CHANGELOG.md#6252-2023-01-18)

### Bug fixes

* Fix an issue where collections in metadata were not present in native Android crashes. [#685](https://github.com/bugsnag/bugsnag-unity/pull/685)

* Fix an issue where errors in serialisation threw exceptions. [#693](https://github.com/bugsnag/bugsnag-unity/pull/693)

* Fix an issue where persisted events had 'unhandled' set to null [#695](https://github.com/bugsnag/bugsnag-unity/pull/695)

## 7.5.0 (2023-01-04)

### Enhancements
Expand Down
2 changes: 1 addition & 1 deletion Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ gem 'xcodeproj'

unless Gem.win_platform?
# Use official Maze Runner release
gem 'bugsnag-maze-runner', git: 'https://github.com/bugsnag/maze-runner', tag: 'v7.10.1'
gem 'bugsnag-maze-runner', git: 'https://github.com/bugsnag/maze-runner', tag: 'v7.11.0'

# Use a specific Maze Runner branch
#gem 'bugsnag-maze-runner', git: 'https://github.com/bugsnag/maze-runner', branch: 'master'
Expand Down
2 changes: 1 addition & 1 deletion build.cake
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ var target = Argument("target", "Default");
var solution = File("./BugsnagUnity.sln");
var configuration = Argument("configuration", "Release");
var project = File("./src/BugsnagUnity/BugsnagUnity.csproj");
var version = "7.5.0";
var version = "7.5.1";

Task("Restore-NuGet-Packages")
.Does(() => NuGetRestore(solution));
Expand Down
41 changes: 41 additions & 0 deletions example/Packages/manifest.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
{
"dependencies": {
"com.bugsnag.unitynotifier": "https://github.com/bugsnag/bugsnag-unity-upm.git",
"com.unity.ads": "2.0.8",
"com.unity.analytics": "3.2.3",
"com.unity.collab-proxy": "1.2.15",
"com.unity.package-manager-ui": "2.0.13",
"com.unity.purchasing": "2.2.1",
"com.unity.textmeshpro": "1.4.1",
"com.unity.modules.ai": "1.0.0",
"com.unity.modules.animation": "1.0.0",
"com.unity.modules.assetbundle": "1.0.0",
"com.unity.modules.audio": "1.0.0",
"com.unity.modules.cloth": "1.0.0",
"com.unity.modules.director": "1.0.0",
"com.unity.modules.imageconversion": "1.0.0",
"com.unity.modules.imgui": "1.0.0",
"com.unity.modules.jsonserialize": "1.0.0",
"com.unity.modules.particlesystem": "1.0.0",
"com.unity.modules.physics": "1.0.0",
"com.unity.modules.physics2d": "1.0.0",
"com.unity.modules.screencapture": "1.0.0",
"com.unity.modules.terrain": "1.0.0",
"com.unity.modules.terrainphysics": "1.0.0",
"com.unity.modules.tilemap": "1.0.0",
"com.unity.modules.ui": "1.0.0",
"com.unity.modules.uielements": "1.0.0",
"com.unity.modules.umbra": "1.0.0",
"com.unity.modules.unityanalytics": "1.0.0",
"com.unity.modules.unitywebrequest": "1.0.0",
"com.unity.modules.unitywebrequestassetbundle": "1.0.0",
"com.unity.modules.unitywebrequestaudio": "1.0.0",
"com.unity.modules.unitywebrequesttexture": "1.0.0",
"com.unity.modules.unitywebrequestwww": "1.0.0",
"com.unity.modules.vehicles": "1.0.0",
"com.unity.modules.video": "1.0.0",
"com.unity.modules.vr": "1.0.0",
"com.unity.modules.wind": "1.0.0",
"com.unity.modules.xr": "1.0.0"
}
}
31 changes: 31 additions & 0 deletions example/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
# Unity Example App

This Application was made to demonstrate various features of the BugSnag Unity notifier.

## Features including:
<ul>
<li>Handled errors and exceptions: Events which can be handled gracefully can also be reported to BugSnag</li>
<li>Crashes: Events which terminate the app are sent to Bugsnag automatically. Reopen the app after a crash to send reports.</li>
<li>Android specific crashes: Native, segfaults, C++, JVM & ANR exceptions. Reopen the app after a crash to send reports</li>
<li>Cocoa sepecific crashes: Native, C++, OOM & App Hangs. Reopen the app after a crash to send reports</li>
</ul>


## Running the app

<ol>
<li>Clone the repo </li>
```
git clone [email protected]:bugsnag/bugsnag-unity.git --recursive
```
<li>Once the project has opened in Unity</li>
<li>Navigate to `Windows>Bugsnag>Configuration`</li>
<li>Enter your Bugsnag project API Key under the basic Configuration section of the package window</li>
<li>Press `Play` in the editor</li>
<li>Once loaded, click any of the error buttons</li>
<li>Confirm whether the BugSnag dashboard has received the error.</li>
</ol>

For more configuration and full information please read the documentation at
https://docs.bugsnag.com/platforms/unity/configuration-options/

9 changes: 1 addition & 8 deletions features/android/android_jvm_errors.feature
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@ Feature: Android JVM Exceptions
And the event "exceptions.0.stacktrace.0.lineNumber" equals 13
And the error payload field "events.0.threads" is null

#NOTE: Metadata testing will be improved in this scenario after PLAT-9127
Scenario: Android JVM Background Thread Smoke Test
When I run the game in the "AndroidBackgroundJVMSmokeTest" state
And I wait for 2 seconds
Expand All @@ -44,6 +43,7 @@ Feature: Android JVM Exceptions
And expected device metadata is included in the event
And expected app metadata is included in the event
And feature flags are included in the event
And custom metadata is included in the event
And the event "breadcrumbs.0.name" equals "Bugsnag loaded"
And the event "breadcrumbs.1.name" equals "test"
And the event "user.id" equals "1"
Expand All @@ -65,13 +65,6 @@ Feature: Android JVM Exceptions
And the event "exceptions.0.stacktrace.0.lineNumber" equals 19
And the error payload field "events.0.threads" is not null

# Metadata
And the event "metaData.init" is null
And the event "metaData.custom.letter" equals "QX"
And the event "metaData.custom.better" equals "400"
And the event "metaData.test.test1" equals "test1"
And the event "metaData.test.test2" is null

And the error payload field "events.0.usage.config" is not null
And the error payload field "events.0.usage.callbacks.onSession" equals 1

Expand Down
8 changes: 2 additions & 6 deletions features/android/android_ndk_errors.feature
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ Feature: Android NDK crash
And the event "severityReason.type" equals "signal"
And the event "severityReason.attributes.signalType" equals "SIGSEGV"
And the event "severityReason.unhandledOverridden" is false
And custom metadata is included in the event
And expected app metadata is included in the event
# Stacktrace validation
And the error payload field "events.0.exceptions.0.stacktrace" is a non-empty array
Expand All @@ -45,9 +46,4 @@ Feature: Android NDK crash
# Native context override
And the event "context" equals "My Context"

# Metadata
And the event "metaData.init" is null
And the event "metaData.custom.letter" equals "QX"
And the event "metaData.custom.better" equals "400"
And the event "metaData.test.test1" equals "test1"
And the event "metaData.test.test2" is null

6 changes: 6 additions & 0 deletions features/csharp/csharp_events.feature
Original file line number Diff line number Diff line change
Expand Up @@ -167,4 +167,10 @@ Feature: csharp events
And the event "severityReason.type" equals "userSpecifiedSeverity"
And the event "unhandled" is false

Scenario: Discard event after serialisation error
When I run the game in the "SerialisationError" state
And I wait to receive 1 error
And the exception "message" equals "SerialisationError"



4 changes: 3 additions & 1 deletion features/csharp/csharp_persistence.feature
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ Feature: Unity Persistence
Background:
Given I clear the Bugsnag cache

@skip_windows @skip_macos @skip_webgl #pending PLAT-8632
@skip_windows @skip_webgl @skip_cocoa @skip_android #pending PLAT-8632
Scenario: Receive a persisted session
When I set the HTTP status code for the next requests to "408"
And I run the game in the "PersistSession" state
Expand Down Expand Up @@ -31,9 +31,11 @@ Feature: Unity Persistence
And I run the game in the "PersistEventReport" state
And I wait to receive 2 errors
And I sort the errors by the payload field "events.0.exceptions.0.message"
And the error is valid for the error reporting API sent by the Unity notifier
And the event "context" equals "Error 1"
And the exception "message" equals "Error 1"
And I discard the oldest error
And the error is valid for the error reporting API sent by the Unity notifier
And the event "context" equals "Error 2"
And the exception "message" equals "Error 2"

Expand Down
16 changes: 16 additions & 0 deletions features/fixtures/maze_runner/Assets/Scenes/MainScene.unity
Original file line number Diff line number Diff line change
Expand Up @@ -1036,6 +1036,9 @@ MonoBehaviour:
m_Script: {fileID: 11500000, guid: e84e72df185f344be9e23af93b2cabc4, type: 3}
m_Name:
m_EditorClassIdentifier:
CustomStacktrace: 'Main.CUSTOM1 () (at Assets/Scripts/Main.cs:123)
Main.CUSTOM2 () (at Assets/Scripts/Main.cs:123)'
--- !u!1 &1160627402
GameObject:
m_ObjectHideFlags: 0
Expand Down Expand Up @@ -2094,6 +2097,7 @@ GameObject:
- component: {fileID: 2039813473}
- component: {fileID: 2039813475}
- component: {fileID: 2039813474}
- component: {fileID: 2039813477}
m_Layer: 0
m_Name: Events
m_TagString: Untagged
Expand Down Expand Up @@ -2340,6 +2344,18 @@ MonoBehaviour:
CustomStacktrace: 'Main.CUSTOM1 () (at Assets/Scripts/Main.cs:123)
Main.CUSTOM2 () (at Assets/Scripts/Main.cs:123)'
--- !u!114 &2039813477
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 2039813460}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: b0623c2806d68426e86c8fc6ba822dd8, type: 3}
m_Name:
m_EditorClassIdentifier:
--- !u!1 &2059449697
GameObject:
m_ObjectHideFlags: 0
Expand Down
42 changes: 28 additions & 14 deletions features/fixtures/maze_runner/Assets/Scripts/Scenario.cs
Original file line number Diff line number Diff line change
Expand Up @@ -87,24 +87,38 @@ private static string FindDotnetApiCompatibility()

public void AddTestingMetadata()
{
Bugsnag.AddMetadata("init", new Dictionary<string, object>(){
{"foo", "bar" },
});
Bugsnag.AddMetadata("test", "test1", "test1");
Bugsnag.AddMetadata("test", "test2", "test2");

Bugsnag.AddMetadata("custom", new Dictionary<string, object>(){
{"letter", "QX" },
{"better", 400 },
{"string-array", new string []{"1","2","3"} },
{"int-array", new int []{1,2,3} },
{"dict", new Dictionary<string,object>(){ {"test" , 123 } } }
{"int", 123 },
{"float", 123.123f },
// {"long", 12345678901234567890 }, pending PLAT-9426
{"double", 123.456 },
{"stringArray", new []{"1",null,"3"} },
{"emptyStringArray", new string[]{} },
{"intList", new List<int>(){1,2,3} },
{"intArray", new []{4,5,6} },
{"stringDict", new Dictionary<string,string>(){ {"hello","goodbye"} } }
});

Bugsnag.AddMetadata("clearMe", new Dictionary<string, object>(){
{"test", "test" },
});

Bugsnag.ClearMetadata("clearMe");

Bugsnag.AddMetadata("test", "test1", "test1");
Bugsnag.AddMetadata("test", "test1", "test2");
Bugsnag.AddMetadata("test", "nullMe", "notNull");
Bugsnag.AddMetadata("test", "nullMe", null);

Bugsnag.AddMetadata("app", new Dictionary<string, object>(){
{"buildno", "0.1" },
{"cache", null },
{"extra", "inApp" }
});
Bugsnag.ClearMetadata("init");
Bugsnag.ClearMetadata("test", "test2");

Bugsnag.AddMetadata("device", new Dictionary<string, object>(){
{"extra", "inDevice" }
});

}

public void AddTestingFeatureFlags()
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
using System;
using BugsnagUnity;

public class SerialisationError : Scenario
{
private class Break
{
public string BrokenString
{
get
{
throw new Exception("BrokenString");
return string.Empty;
}
}
}

public override void Run()
{
Bugsnag.AddOnError(BrokenCallback);

DoSimpleNotify("SerialisationErrorBroken"); //this should not get delivered

Bugsnag.RemoveOnError(BrokenCallback);

DoSimpleNotify("SerialisationError"); //this one should
}

private bool BrokenCallback(IEvent @event)
{
@event.AddMetadata("Test", "Test", new Break());
return true;
}
}

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

18 changes: 3 additions & 15 deletions features/ios/ios_native_errors.feature
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ Feature: iOS Native Errors
And I run the game in the "StartSDKDefault" state
And I wait to receive an error
And expected device metadata is included in the event
And custom metadata is included in the event
And feature flags are included in the event
And the event "breadcrumbs.0.name" equals "Bugsnag loaded"
And the event "breadcrumbs.1.name" equals "test"
Expand All @@ -47,7 +48,6 @@ Feature: iOS Native Errors
And the event "app.version" is not null
And the event "metaData.app.companyName" equals "bugsnag"
And the event "metaData.app.name" matches ".azerunner"
And the event "metaData.app.buildno" is not null

# Exception details
And the error payload field "events" is an array with 1 elements
Expand All @@ -56,13 +56,6 @@ Feature: iOS Native Errors
And the event "unhandled" is true
And the event "severity" equals "error"

# Metadata
And the event "metaData.init" is null
And the event "metaData.custom.letter" equals "QX"
And the event "metaData.custom.better" equals 400
And the event "metaData.test.test1" equals "test1"
And the event "metaData.test.test2" is null

# Telemetry
And the error payload field "events.0.usage.config" is not null
And the error payload field "events.0.usage.callbacks.onSession" equals 1
Expand All @@ -75,6 +68,8 @@ Feature: iOS Native Errors
And I run the game in the "StartSDKDefault" state
And I wait to receive an error
And expected device metadata is included in the event
And custom metadata is included in the event

And feature flags are included in the event
And the event "breadcrumbs.0.name" equals "Bugsnag loaded"
And the event "breadcrumbs.1.name" equals "test"
Expand All @@ -92,7 +87,6 @@ Feature: iOS Native Errors
And the event "app.version" is not null
And the event "metaData.app.companyName" equals "bugsnag"
And the event "metaData.app.name" matches ".azerunner"
And the event "metaData.app.buildno" is not null

# Exception details
And the error payload field "events" is an array with 1 elements
Expand All @@ -103,12 +97,6 @@ Feature: iOS Native Errors
And the error payload field "events.0.exceptions.0.stacktrace" is a non-empty array
And the event "exceptions.0.stacktrace.0.method" equals "__pthread_kill"

# Metadata
And the event "metaData.init" is null
And the event "metaData.custom.letter" equals "QX"
And the event "metaData.custom.better" equals 400
And the event "metaData.test.test1" equals "test1"
And the event "metaData.test.test2" is null



Expand Down
Loading

0 comments on commit e2744cb

Please sign in to comment.