Skip to content

Commit

Permalink
Version 3.7.3 (#145)
Browse files Browse the repository at this point in the history
* Do not test native client on not supported platforms

* Invalid cast (#144)

* prevent monitor disposing in the disable method (#143)

* Use game object name instead of 'backtrace'

* Version update + make sure backtrace-unity don't throw an exception when disk is full

* Typo

* Changelog

* Add attributes to runtime xception

Co-authored-by: Vincent Lussenburg <[email protected]>
Co-authored-by: Lysanne Pinto <[email protected]>
  • Loading branch information
3 people authored Dec 22, 2021
1 parent a8138c2 commit 18f4114
Show file tree
Hide file tree
Showing 5 changed files with 28 additions and 10 deletions.
9 changes: 9 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,14 @@
# Backtrace Unity Release Notes

## Version 3.7.3

Bugfixes
- Fixed the game object name issue used by native integration when ANR or background exception occured,
- fixed invalid cast in the screenshot generation algorithm,
- fixed a problem with the dispose method in the Backtrace Android native integration - now backtrace-unity will dispose native integation only once.
- prevent from throwing an exception from the BacktraceDatabase object if BacktraceDatabaseAttachments object generates attachment and disk is full.


## Version 3.7.2

Bugfixes
Expand Down
6 changes: 4 additions & 2 deletions Runtime/BacktraceClient.cs
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ namespace Backtrace.Unity
/// </summary>
public class BacktraceClient : MonoBehaviour, IBacktraceClient
{
public const string VERSION = "3.7.2";
public const string VERSION = "3.7.3";
internal const string DefaultBacktraceGameObjectName = "BacktraceClient";
public BacktraceConfiguration Configuration;

Expand Down Expand Up @@ -993,7 +993,9 @@ internal void HandleUnhandledExceptionsFromAndroidBackgroundThread(string backgr
var stackTrace = backgroundExceptionMessage.Substring(splitIndex);
if (Database != null)
{
Database.Add(new BacktraceReport(new BacktraceUnhandledException(message, stackTrace)).ToBacktraceData(null, GameObjectDepth));
var backtraceData = new BacktraceReport(new BacktraceUnhandledException(message, stackTrace)).ToBacktraceData(null, GameObjectDepth);
AttributeProvider.AddAttributes(backtraceData.Attributes.Attributes);
Database.Add(backtraceData);
}
else
{
Expand Down
15 changes: 11 additions & 4 deletions Runtime/Model/Database/BacktraceDatabaseAttachmentManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,16 @@ public IEnumerable<string> GetReportAttachments(BacktraceData data)
var attachmentPrefix = data.UuidString;

var result = new List<string>();
AddIfPathIsNotEmpty(result, GetScreenshotPath(attachmentPrefix));
AddIfPathIsNotEmpty(result, GetUnityPlayerLogFile(data, attachmentPrefix));
AddIfPathIsNotEmpty(result, GetMinidumpPath(data, attachmentPrefix));
try
{
AddIfPathIsNotEmpty(result, GetScreenshotPath(attachmentPrefix));
AddIfPathIsNotEmpty(result, GetUnityPlayerLogFile(data, attachmentPrefix));
AddIfPathIsNotEmpty(result, GetMinidumpPath(data, attachmentPrefix));
}
catch (Exception e)
{
Debug.LogWarning(string.Format("Cannot generate report attachments. Reason: {0}", e.Message));
}
return result;
}

Expand Down Expand Up @@ -100,7 +107,7 @@ private string GetScreenshotPath(string dataPrefix)
{
Texture2D result;

float ratio = Screen.width / Screen.height;
float ratio = (float)Screen.width / (float)Screen.height;
var applyDefaultSettings = ScreenshotMaxHeight == Screen.height;
int targetHeight = applyDefaultSettings ? Screen.height : Mathf.Min(Screen.height, ScreenshotMaxHeight);
int targetWidth = applyDefaultSettings ? Screen.width : Mathf.RoundToInt(targetHeight * ratio);
Expand Down
6 changes: 3 additions & 3 deletions Runtime/Native/Android/NativeClient.cs
Original file line number Diff line number Diff line change
Expand Up @@ -158,12 +158,11 @@ private void HandleUnhandledExceptions()
const string callbackName = "HandleUnhandledExceptionsFromAndroidBackgroundThread";
try
{
_unhandledExceptionWatcher = new AndroidJavaObject(_unhandledExceptionPath, "Backtrace", callbackName);
_unhandledExceptionWatcher = new AndroidJavaObject(_unhandledExceptionPath, GameObjectName, callbackName);
}
catch (Exception e)
{
Debug.LogWarning(string.Format("Cannot initialize unhandled exception watcher - reason: {0}", e.Message));
_enabled = false;
}
}

Expand Down Expand Up @@ -397,7 +396,6 @@ public void HandleAnr()
catch (Exception e)
{
Debug.LogWarning(string.Format("Cannot initialize ANR watchdog - reason: {0}", e.Message));
_enabled = false;
}

if (!CaptureNativeCrashes)
Expand Down Expand Up @@ -504,11 +502,13 @@ public override void Disable()
{
_anrWatcher.Call("stopMonitoring");
_anrWatcher.Dispose();
_anrWatcher = null;
}
if (_unhandledExceptionWatcher != null)
{
_unhandledExceptionWatcher.Call("stopMonitoring");
_unhandledExceptionWatcher.Dispose();
_unhandledExceptionWatcher = null;
}
base.Disable();
}
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "io.backtrace.unity",
"displayName": "Backtrace",
"version": "3.7.2",
"version": "3.7.3",
"unity": "2017.1",
"description": "Backtrace's integration with Unity games allows customers to capture and report handled and unhandled Unity exceptions to their Backtrace instance, instantly offering the ability to prioritize and debug software errors.",
"keywords": [
Expand Down

0 comments on commit 18f4114

Please sign in to comment.