Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
86 commits
Select commit Hold shift + click to select a range
b5d1e98
Unity web request + IEnumerator interface
konraddysput Oct 23, 2018
7ac9ced
Correct way to send diagnostic JSON to API
konraddysput Oct 24, 2018
3b309a9
Client modification. Code refactor for BacktraceApi
konraddysput Oct 24, 2018
5969eb2
Database modifications
konraddysput Nov 1, 2018
208e030
Changes project structure + Convert JSON.NET from dll to source files…
konraddysput Nov 4, 2018
21a0000
JSON.NET namespace and names modification + Database and Client fixes
konraddysput Nov 5, 2018
7fc89ba
Removed old Newtonsoft class
konraddysput Nov 5, 2018
dda6948
Attachment support
konraddysput Nov 6, 2018
501d2c8
sample usage
konraddysput Nov 6, 2018
8fc2f57
sample usage video rename
konraddysput Nov 6, 2018
6943fe4
Renamed client name
konraddysput Nov 6, 2018
3b5b854
Removed useless properties and obj files
konraddysput Nov 7, 2018
e7a5d9d
Changing labels and properties positions
konraddysput Nov 7, 2018
7960804
Create database directory flag
konraddysput Nov 7, 2018
b967d55
Flag for handling unhandled exceptions
konraddysput Nov 7, 2018
4a22531
Unhandled exception method invoke
konraddysput Nov 7, 2018
cb1cc8e
Validation rules for database path
konraddysput Nov 7, 2018
2cb7c1f
removed media file
konraddysput Nov 7, 2018
c5a0574
New attributes
konraddysput Nov 7, 2018
15dee8f
Readme
konraddysput Nov 7, 2018
88cc60e
Removed dependencies information
konraddysput Nov 7, 2018
708009c
removed diagnostic log
konraddysput Nov 7, 2018
a934e70
Diffrent configuration unity editor
konraddysput Nov 9, 2018
425a490
Readme update
konraddysput Nov 9, 2018
3faf0d7
stack trace modification
konraddysput Nov 9, 2018
2e23998
Backtrace icon
konraddysput Nov 9, 2018
6639f22
Send method extensions
konraddysput Nov 9, 2018
2704aa3
Removed namespaces/features that use Assembly class
konraddysput Nov 10, 2018
4e2bfbc
Nullable database fix
konraddysput Nov 11, 2018
d41dc4d
Removed process information for il2cpp build
konraddysput Nov 11, 2018
b4f1320
IL2CPP friendly JSON
konraddysput Nov 12, 2018
774d498
Database serialization
konraddysput Nov 12, 2018
fe05b0d
Removed file logger
konraddysput Nov 12, 2018
efc4676
Fix database timer
konraddysput Nov 13, 2018
c67de20
Additional unhandled information + is debug attribute
konraddysput Nov 14, 2018
a91d846
Backtrace unahndle exception stack trace
konraddysput Nov 21, 2018
80a7a61
Update README.md
Nov 21, 2018
dd20a67
Package.json + removed file writer
konraddysput Nov 21, 2018
c7caecc
Merge branch 'dev' of https://github.com/backtrace-labs/backtrace-uni…
konraddysput Nov 21, 2018
3a0f458
Update README.md
konraddysput Nov 21, 2018
67e91ab
unit tests + code refactor (#4)
konraddysput Dec 3, 2018
a44618e
Merge
konraddysput Mar 6, 2019
8095b43
Changelog and readme changes
konraddysput Mar 6, 2019
854f427
token fix in readme.md
konraddysput Mar 6, 2019
6c25157
Removed tests assembly
konraddysput Mar 7, 2019
355eced
Removed not used test
konraddysput Mar 8, 2019
0f32fed
Renamed directories
konraddysput Mar 8, 2019
a3cd1ae
Removed duplicated directory
konraddysput Mar 8, 2019
0c8ee08
merge
konraddysput Mar 19, 2019
f84c68b
Detailed error message when plugin cannot send data to Backtrace + so…
konraddysput Mar 28, 2019
3df7945
changelog update
konraddysput Mar 28, 2019
d9996d8
Version update
konraddysput Mar 28, 2019
a60413d
Merge branch 'master' into dev
konraddysput Mar 28, 2019
9c35b40
Invalid/empty token additional condition
konraddysput Jun 3, 2019
b84a7e6
After merge
konraddysput Jun 3, 2019
6946dc0
Attachment support - solved an issue with rxId and objectId
konraddysput Jun 6, 2019
4bbd770
Version update + Changelog
konraddysput Jun 6, 2019
8e64366
Merge branch 'master' into dev
konraddysput Jun 6, 2019
2750035
Merge branch 'master' into dev
konraddysput Jun 7, 2019
8ba2e14
Ignore ssl validation flag
konraddysput Aug 12, 2019
530a7f4
Removed Backtrace url checks
konraddysput Aug 20, 2019
666ccbe
Package update
konraddysput Aug 27, 2019
0c77fa6
Test don't destroy on load
konraddysput Jan 8, 2020
c45579d
New annotations and attribuites
konraddysput Jan 9, 2020
7c73e47
Unity update - before merge
konraddysput Jan 9, 2020
1cb9141
Version update
konraddysput Jan 9, 2020
fdaa2e7
Version update
konraddysput Jan 9, 2020
3ecbc86
Merge branch 'master' into dev
konraddysput Jan 9, 2020
bbf0e73
Added library name
konraddysput Jan 17, 2020
0b96bca
Merge branch 'dev' of https://github.com/backtrace-labs/backtrace-uni…
konraddysput Jan 17, 2020
99143df
Client side deduplication implementation
konraddysput Jan 21, 2020
2d7c9ec
Client rate limit changes
konraddysput Jan 28, 2020
3318086
Unit tests - before client side deduplication unit tests
konraddysput Jan 28, 2020
ab5bd73
Dedupliaction UI + bug fixes (database retry fix) + default values
konraddysput Feb 3, 2020
38f98d0
Fixed multiple assets file names
konraddysput Feb 3, 2020
d99ff84
Unit test continuation + mocks object
konraddysput Feb 4, 2020
3e165e8
Extended mock objects
konraddysput Feb 4, 2020
f28c9d3
Unit tests update + abstraction layer for few database/clients methods
konraddysput Feb 5, 2020
7c40aa9
Merge branch 'master' into dev
konraddysput Feb 5, 2020
a4a41c2
Merge fixes
konraddysput Feb 6, 2020
0c7afe7
added details for new fingerprint property
Feb 6, 2020
f4e1367
Fingerprint details
Feb 6, 2020
6bf6a28
Stack trace changes, documentation updates + fixed invalid includes t…
konraddysput Feb 7, 2020
c5f3ad8
Version update
konraddysput Feb 7, 2020
54364b9
Updated readme/changelog + application version
konraddysput Feb 7, 2020
02f1847
Added details on fingerprint
Feb 6, 2020
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
37 changes: 30 additions & 7 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,13 +1,30 @@
[Ll]ibrary/
[Tt]emp/
[Oo]bj/
[Bb]uild/
[Bb]uilds/
Assets/AssetStoreTools*
# This .gitignore file should be placed at the root of your Unity project directory
#
# Get latest from https://github.com/github/gitignore/blob/master/Unity.gitignore
#
/[Ll]ibrary/
/[Tt]emp/
/[Oo]bj/
/[Bb]uild/
/[Bb]uilds/
/[Ll]ogs/
/[Mm]emoryCaptures/

# Asset meta data should only be ignored when the corresponding asset is also ignored
!/[Aa]ssets/**/*.meta

# Uncomment this line if you wish to ignore the asset store tools plugin
# /[Aa]ssets/AssetStoreTools*

# Autogenerated Jetbrains Rider plugin
/[Aa]ssets/Plugins/Editor/JetBrains*

# Visual Studio cache directory
.vs/

# Gradle cache directory
.gradle/

# Autogenerated VS/MD/Consulo solution and project files
ExportedObj/
.consulo/
Expand All @@ -22,15 +39,21 @@ ExportedObj/
*.booproj
*.svd
*.pdb
*.mdb
*.opendb
*.VC.db

# Unity3D generated meta files
*.pidb.meta
*.pdb.meta
*.mdb.meta

# Unity3D Generated File On Crash Reports
# Unity3D generated file on crash reports
sysinfo.txt

# Builds
*.apk
*.unitypackage

# Crashlytics generated file
crashlytics-build.properties
10 changes: 10 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,15 @@
# Backtrace Unity Release Notes

## Version 2.0.0
- Backtrace-Unity plugin will set `"Destroy object on new scene"` by default to false.
- Backtrace stack trace improvements,
- `BacktraceDatabase` retry method now respect correctly `BacktraceDatabase` `retryInterval` property,
- New `Backtrace Configuration` won't override existing `Backtrace Configuration` in configuration directory.
- Backtrace-Unity plugin tests now won't override some files in Backtrace-Database unit tests,
- Backtrace-Unity plugin now allows you to setup client side deduplication rules via `Fingerprint`. By using this field you can limit reporting of an error that occurs many times over a few frames.
- Backtrace report limit watcher feature now will validate limits before BacktraceReport creation.
- `BacktraceClient` and `BacktraceDatabase` now expose `Reload` method. You can use this method do dynamically change `BacktraceClient`/`BacktraceDatabase` configurations.

## Version 1.1.5 - 09.01.2019
- Added support to DontDestroyOnLoad property. Right now users might use this property to store `BacktraceClient`/`BacktraceDatabase` instances between all game scenes.
- Added more attributes to `BacktraceReport` object,
Expand Down
9 changes: 7 additions & 2 deletions Editor/Menu/BacktraceClientConfigurationEditor.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
#if UNITY_EDITOR
using Backtrace.Unity.Model;
using Backtrace.Unity.Types;
using System.IO;
using UnityEditor;
using UnityEngine;
Expand All @@ -13,7 +14,9 @@ public class BacktraceClientConfigurationEditor : UnityEditor.Editor
public const string LABEL_REPORT_PER_MIN = "Reports per minute";
public const string LABEL_HANDLE_UNHANDLED_EXCEPTION = "Handle unhandled exceptions";
public const string LABEL_IGNORE_SSL_VALIDATION = "Ignore SSL validation";
public const string LABEL_DONT_DESTROY_BACKTRACE_ON_SCENE_LOAD = "Don't destroy Backtrace client on scene load";
public const string LABEL_DEDUPLICATION_RULES = "Deduplication rules";
public const string LABEL_DONT_DESTROY_BACKTRACE_ON_SCENE_LOAD = "Don't destroy on scene load";




Expand All @@ -29,10 +32,12 @@ public override void OnInspectorGUI()
{
EditorGUILayout.HelpBox("Detected different pattern of url. Please make sure its a valid Backtrace url!", MessageType.Warning);
}

settings.DestroyOnLoad = EditorGUILayout.Toggle(LABEL_DONT_DESTROY_BACKTRACE_ON_SCENE_LOAD, settings.DestroyOnLoad);
settings.ReportPerMin = EditorGUILayout.IntField(LABEL_REPORT_PER_MIN, settings.ReportPerMin);
settings.HandleUnhandledExceptions = EditorGUILayout.Toggle(LABEL_HANDLE_UNHANDLED_EXCEPTION, settings.HandleUnhandledExceptions);
settings.IgnoreSslValidation = EditorGUILayout.Toggle(LABEL_IGNORE_SSL_VALIDATION, settings.IgnoreSslValidation);
settings.DestroyOnLoad = EditorGUILayout.Toggle(LABEL_DONT_DESTROY_BACKTRACE_ON_SCENE_LOAD, settings.DestroyOnLoad);
settings.DeduplicationStrategy = (DeduplicationStrategy)EditorGUILayout.EnumPopup(LABEL_DEDUPLICATION_RULES, settings.DeduplicationStrategy);
}
}

Expand Down
2 changes: 1 addition & 1 deletion Editor/Menu/BacktraceClientEditor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ public override void OnInspectorGUI()
false);
if (component.Configuration != null)
{
BacktraceConfigurationEditor editor = (BacktraceConfigurationEditor)CreateEditor(component.Configuration);
var editor = (BacktraceConfigurationEditor)CreateEditor(component.Configuration);
editor.OnInspectorGUI();
if (component.Configuration.Enabled && component.gameObject.GetComponent<BacktraceDatabase>() == null)
{
Expand Down
8 changes: 7 additions & 1 deletion Editor/Menu/BacktraceConfigurationEditor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@ public class BacktraceConfigurationEditor : UnityEditor.Editor
public const string LABEL_HANDLE_UNHANDLED_EXCEPTION = "Handle unhandled exceptions";
public const string LABEL_ENABLE_DATABASE = "Enable Database";
public const string LABEL_IGNORE_SSL_VALIDATION = "Ignore SSL validation";
public const string LABEL_DEDUPLICATION_RULES = "Deduplication rules";

public const string LABEL_DESTROY_CLIENT_ON_SCENE_LOAD = "Destroy client on new scene load";

public const string LABEL_PATH = "Backtrace database path";
Expand Down Expand Up @@ -44,11 +46,15 @@ public override void OnInspectorGUI()
SerializedProperty sslValidation = serializedObject.FindProperty("IgnoreSslValidation");
EditorGUILayout.PropertyField(sslValidation, new GUIContent(LABEL_IGNORE_SSL_VALIDATION));


SerializedProperty deduplicationStrategy = serializedObject.FindProperty("DeduplicationStrategy");
EditorGUILayout.PropertyField(deduplicationStrategy, new GUIContent(LABEL_DEDUPLICATION_RULES));

SerializedProperty destroyOnLoad = serializedObject.FindProperty("DestroyOnLoad");
EditorGUILayout.PropertyField(destroyOnLoad, new GUIContent(LABEL_DESTROY_CLIENT_ON_SCENE_LOAD));

SerializedProperty enabled = serializedObject.FindProperty("Enabled");
EditorGUILayout.PropertyField(enabled, new GUIContent(LABEL_ENABLE_DATABASE));
EditorGUILayout.PropertyField(enabled, new GUIContent(LABEL_ENABLE_DATABASE));

if (enabled.boolValue)
{
Expand Down
38 changes: 31 additions & 7 deletions Editor/Menu/BacktraceMenu.cs
Original file line number Diff line number Diff line change
@@ -1,14 +1,17 @@
#if UNITY_EDITOR
using Backtrace.Unity.Model;
using System.IO;
using System.Linq;
using UnityEditor;
using UnityEngine;
using Backtrace.Unity.Model;

namespace Backtrace.Unity.Editor
{
public class BacktraceMenu : MonoBehaviour
{
public const string DEFAULT_CLIENT_CONFIGURATION_NAME = "Backtrace Configuration.asset";
public const string DEFAULT_CONFIGURATION_NAME = "Backtrace Configuration";
public const string DEFAULT_EXTENSION_NAME = ".asset";
public const string DEFAULT_CLIENT_CONFIGURATION_NAME = DEFAULT_CONFIGURATION_NAME + DEFAULT_EXTENSION_NAME;

[MenuItem("Assets/Backtrace/Configuration", false, 1)]
public static void CreateClientConfigurationFile()
Expand All @@ -19,7 +22,7 @@ public static void CreateClientConfigurationFile()
private static void CreateAsset<T>(string fileName) where T : ScriptableObject
{
T asset = ScriptableObject.CreateInstance<T>();
string currentProjectPath = AssetDatabase.GetAssetPath(Selection.activeObject);
var currentProjectPath = AssetDatabase.GetAssetPath(Selection.activeObject);
if (string.IsNullOrEmpty(currentProjectPath))
{
currentProjectPath = "Assets";
Expand All @@ -28,11 +31,32 @@ private static void CreateAsset<T>(string fileName) where T : ScriptableObject
{
currentProjectPath = Path.GetDirectoryName(currentProjectPath);
}
AssetDatabase.CreateAsset(asset, "Assets/" + fileName);
AssetDatabase.SaveAssets();

var destinationPath = Path.Combine(currentProjectPath, fileName);
AssetDatabase.MoveAsset("Assets/" + fileName, destinationPath);
if (File.Exists(destinationPath))
{
var files = Directory.GetFiles(currentProjectPath);
var lastFileIndex = files
.Where(n =>
Path.GetFileNameWithoutExtension(n).StartsWith(DEFAULT_CONFIGURATION_NAME) &&
Path.GetExtension(n) == DEFAULT_EXTENSION_NAME)
.Select(n =>
{
int startIndex = n.IndexOf('(') + 1;
int endIndex = n.IndexOf(')');
if (startIndex != 0 && endIndex != -1 && int.TryParse(n.Substring(startIndex, endIndex - startIndex), out int result))
{
return result;
}
return 0;
})
.DefaultIfEmpty().Max();

lastFileIndex++;
destinationPath = Path.Combine(currentProjectPath, $"{DEFAULT_CONFIGURATION_NAME}({lastFileIndex}){DEFAULT_EXTENSION_NAME}");
}
Debug.Log($"Generating new Backtrace configuration file available in path: {destinationPath}");
AssetDatabase.CreateAsset(asset, destinationPath);
AssetDatabase.SaveAssets();
Selection.activeObject = asset;
}
}
Expand Down
41 changes: 41 additions & 0 deletions Editor/Tests/BacktraceBaseTest.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
using UnityEngine;
using System.Collections;
using Backtrace.Unity;
using Backtrace.Unity.Model;
using NUnit.Framework;

public class BacktraceBaseTest : MonoBehaviour
{
protected GameObject GameObject;
protected BacktraceClient BacktraceClient;
protected void BeforeSetup()
{
Debug.unityLogger.logEnabled = false;
GameObject = new GameObject();
GameObject.SetActive(false);
BacktraceClient = GameObject.AddComponent<BacktraceClient>();
}

protected void AfterSetup(bool refresh = true)
{
if (refresh)
{
BacktraceClient.Refresh();
}
GameObject.SetActive(true);
}

protected BacktraceConfiguration GetBasicConfiguration()
{
var configuration = ScriptableObject.CreateInstance<BacktraceConfiguration>();
configuration.ServerUrl = "https://submit.backtrace.io/test/token/json";
configuration.DestroyOnLoad = true;
return configuration;
}

[TearDown]
public void Cleanup()
{
DestroyImmediate(GameObject);
}
}
11 changes: 11 additions & 0 deletions Editor/Tests/BacktraceBaseTest.cs.meta

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

Loading