Skip to content

Commit 3398863

Browse files
authored
Merge pull request #775 from bugsnag/next
Release v7.2.2
2 parents d9a27d5 + bea3ae5 commit 3398863

File tree

11 files changed

+131
-8
lines changed

11 files changed

+131
-8
lines changed

.buildkite/pipeline.full.yml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -324,6 +324,7 @@ steps:
324324
- features/fixtures/maze_runner/mazerunner_2018.4.36f1.apk
325325
- features/fixtures/build_android_apk.log
326326
commands:
327+
- bundle install
327328
- rake test:android:build
328329
retry:
329330
automatic:
@@ -344,6 +345,7 @@ steps:
344345
- features/fixtures/maze_runner/mazerunner_2019.4.35f1.apk
345346
- features/fixtures/build_android_apk.log
346347
commands:
348+
- bundle install
347349
- rake test:android:build
348350
retry:
349351
automatic:
@@ -364,6 +366,7 @@ steps:
364366
- features/fixtures/maze_runner/mazerunner_2021.3.27f1.apk
365367
- features/fixtures/build_android_apk.log
366368
commands:
369+
- bundle install
367370
- rake test:android:build
368371
retry:
369372
automatic:
@@ -384,6 +387,7 @@ steps:
384387
- features/fixtures/maze_runner/mazerunner_2022.3.2f1.apk
385388
- features/fixtures/build_android_apk.log
386389
commands:
390+
- bundle install
387391
- rake test:android:build
388392
retry:
389393
automatic:
@@ -581,6 +585,7 @@ steps:
581585
- features/fixtures/unity.log
582586
- project_2018.tgz
583587
commands:
588+
- bundle install
584589
- rake test:ios:generate_xcode
585590
- tar -zvcf project_2018.tgz features/fixtures/maze_runner/mazerunner_xcode
586591
retry:
@@ -606,6 +611,7 @@ steps:
606611
- features/fixtures/maze_runner/mazerunner_2018.4.36f1.ipa
607612
- features/fixtures/unity.log
608613
commands:
614+
- bundle install
609615
- tar -zxf project_2018.tgz features/fixtures/maze_runner
610616
- rake test:ios:build_xcode
611617
retry:
@@ -627,6 +633,7 @@ steps:
627633
- features/fixtures/unity.log
628634
- project_2019.tgz
629635
commands:
636+
- bundle install
630637
- rake test:ios:generate_xcode
631638
- tar -zvcf project_2019.tgz features/fixtures/maze_runner/mazerunner_xcode
632639
retry:
@@ -652,6 +659,7 @@ steps:
652659
- features/fixtures/maze_runner/mazerunner_2019.4.35f1.ipa
653660
- features/fixtures/unity.log
654661
commands:
662+
- bundle install
655663
- tar -zxf project_2019.tgz features/fixtures/maze_runner
656664
- rake test:ios:build_xcode
657665
retry:
@@ -673,6 +681,7 @@ steps:
673681
- features/fixtures/unity.log
674682
- project_2021.tgz
675683
commands:
684+
- bundle install
676685
- rake test:ios:generate_xcode
677686
- tar -zvcf project_2021.tgz features/fixtures/maze_runner/mazerunner_xcode
678687
retry:
@@ -698,6 +707,7 @@ steps:
698707
- features/fixtures/maze_runner/mazerunner_2021.3.27f1.ipa
699708
- features/fixtures/unity.log
700709
commands:
710+
- bundle install
701711
- tar -zxf project_2021.tgz features/fixtures/maze_runner
702712
- rake test:ios:build_xcode
703713
retry:
@@ -719,6 +729,7 @@ steps:
719729
- features/fixtures/unity.log
720730
- project_2022.tgz
721731
commands:
732+
- bundle install
722733
- rake test:ios:generate_xcode
723734
- tar -zvcf project_2022.tgz features/fixtures/maze_runner/mazerunner_xcode
724735
retry:
@@ -744,6 +755,7 @@ steps:
744755
- features/fixtures/maze_runner/mazerunner_2022.3.2f1.ipa
745756
- features/fixtures/unity.log
746757
commands:
758+
- bundle install
747759
- tar -zxf project_2022.tgz features/fixtures/maze_runner
748760
- rake test:ios:build_xcode
749761
retry:

.buildkite/pipeline.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,7 @@ steps:
7070
- features/fixtures/maze_runner/mazerunner_2020.3.48f1.apk
7171
- features/fixtures/build_android_apk.log
7272
commands:
73+
- bundle install
7374
- rake test:android:build
7475
retry:
7576
automatic:
@@ -176,6 +177,7 @@ steps:
176177
- features/fixtures/unity.log
177178
- project_2020.tgz
178179
commands:
180+
- bundle install
179181
- rake test:ios:generate_xcode
180182
- tar -zvcf project_2020.tgz features/fixtures/maze_runner/mazerunner_xcode
181183
retry:
@@ -199,6 +201,7 @@ steps:
199201
- features/fixtures/maze_runner/mazerunner_2020.3.48f1.ipa
200202
- features/fixtures/unity.log
201203
commands:
204+
- bundle install
202205
- tar -zxf project_2020.tgz features/fixtures/maze_runner
203206
- rake test:ios:build_xcode
204207
retry:

CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,11 @@
11
# Changelog
22

3+
## 7.7.2 (2024-03-01)
4+
5+
### Enhancements
6+
7+
- Improved handling of serialisation errors when flushing the event cache [#773](https://github.com/bugsnag/bugsnag-unity/pull/773)
8+
39
## 7.7.1 (2024-01-25)
410

511
### Bug Fixes

Gemfile

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,12 @@ source 'https://rubygems.org'
33
gem 'rake'
44
gem 'xcpretty'
55
gem 'xcodeproj'
6+
gem 'cocoapods'
7+
gem 'rake'
68

79
unless Gem.win_platform?
810
# Use official Maze Runner release
9-
gem 'bugsnag-maze-runner', '~>8.0'
11+
gem 'bugsnag-maze-runner', '~>9.0'
1012

1113
# Use a specific Maze Runner branch
1214
# gem 'bugsnag-maze-runner', git: 'https://github.com/bugsnag/maze-runner', branch: 'master'

build.cake

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ var target = Argument("target", "Default");
55
var solution = File("./BugsnagUnity.sln");
66
var configuration = Argument("configuration", "Release");
77
var project = File("./src/BugsnagUnity/BugsnagUnity.csproj");
8-
var version = "7.7.1";
8+
var version = "7.7.2";
99

1010
Task("Restore-NuGet-Packages")
1111
.Does(() => NuGetRestore(solution));

features/csharp/csharp_persistence.feature

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -103,3 +103,15 @@ Feature: Unity Persistence
103103
And the exception "message" equals "PersistDeviceId"
104104
And the error payload field "events.0.device.id" equals the stored value "device_id"
105105

106+
Scenario: Handle Corrupt Json
107+
And I run the game in the "CorruptedCacheFile" state
108+
And I wait for requests to persist
109+
And I close the Unity app
110+
And On Mobile I relaunch the app
111+
And I run the game in the "PersistEventReport" state
112+
And I wait for requests to persist
113+
And I wait to receive 1 errors
114+
And the error is valid for the error reporting API sent by the Unity notifier
115+
And the exception "message" equals "Error 2"
116+
117+

features/fixtures/maze_runner/Assets/Scenes/MainScene.unity

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ RenderSettings:
3838
m_ReflectionIntensity: 1
3939
m_CustomReflection: {fileID: 0}
4040
m_Sun: {fileID: 0}
41-
m_IndirectSpecularColor: {r: 0.3731192, g: 0.38073966, b: 0.35872677, a: 1}
41+
m_IndirectSpecularColor: {r: 0.3731316, g: 0.38074902, b: 0.3587254, a: 1}
4242
m_UseRadianceAmbientProbe: 0
4343
--- !u!157 &3
4444
LightmapSettings:
@@ -1537,6 +1537,7 @@ GameObject:
15371537
- component: {fileID: 1523264808}
15381538
- component: {fileID: 1523264809}
15391539
- component: {fileID: 1523264810}
1540+
- component: {fileID: 1523264811}
15401541
m_Layer: 0
15411542
m_Name: Persistence
15421543
m_TagString: Untagged
@@ -1678,6 +1679,21 @@ MonoBehaviour:
16781679
CustomStacktrace: 'Main.CUSTOM1 () (at Assets/Scripts/Main.cs:123)
16791680
16801681
Main.CUSTOM2 () (at Assets/Scripts/Main.cs:123)'
1682+
--- !u!114 &1523264811
1683+
MonoBehaviour:
1684+
m_ObjectHideFlags: 0
1685+
m_CorrespondingSourceObject: {fileID: 0}
1686+
m_PrefabInstance: {fileID: 0}
1687+
m_PrefabAsset: {fileID: 0}
1688+
m_GameObject: {fileID: 1523264801}
1689+
m_Enabled: 1
1690+
m_EditorHideFlags: 0
1691+
m_Script: {fileID: 11500000, guid: 395039af028ee4010baf61afa7f7e066, type: 3}
1692+
m_Name:
1693+
m_EditorClassIdentifier:
1694+
CustomStacktrace: 'Main.CUSTOM1 () (at Assets/Scripts/Main.cs:123)
1695+
1696+
Main.CUSTOM2 () (at Assets/Scripts/Main.cs:123)'
16811697
--- !u!1 &1746155638
16821698
GameObject:
16831699
m_ObjectHideFlags: 0
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
using System.Collections;
2+
using System.Collections.Generic;
3+
using System.IO;
4+
using UnityEngine;
5+
6+
public class CorruptedCacheFile : Scenario
7+
{
8+
9+
public override void PrepareConfig(string apiKey, string host)
10+
{
11+
base.PrepareConfig(apiKey, host);
12+
if (Application.platform == RuntimePlatform.IPhonePlayer)
13+
{
14+
Configuration.EnabledErrorTypes.OOMs = false;
15+
}
16+
}
17+
18+
public override void Run()
19+
{
20+
var dirPath = Application.persistentDataPath + "/Bugsnag/Events";
21+
if (!Directory.Exists(dirPath))
22+
{
23+
Directory.CreateDirectory(dirPath);
24+
}
25+
File.WriteAllText(dirPath + "/f04274f7-6f7d-448e-b62e-486cc019a708.event", "NOT JSON");
26+
}
27+
}

features/fixtures/maze_runner/Assets/Scripts/Scenarios/Csharp/Persistence/CorruptedCacheFile.cs.meta

Lines changed: 11 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/BugsnagUnity/Delivery.cs

Lines changed: 34 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -524,21 +524,51 @@ private IEnumerator ProcessCachedItems(Type t)
524524

525525
try
526526
{
527+
// if something goes wrong at this stage then we silently discard the file as it's most likely that the file wasn't fully serialised to disk
527528
payloadDictionary = ((JsonObject)SimpleJson.DeserializeObject(payloadJson)).GetDictionary();
528529
}
529-
catch (Exception e)
530+
catch
530531
{
531-
Debug.LogException(new Exception("Bugsnag Error. Deserialising a cached payload for delivery failed: " + e.Message + " Cached json: " + payloadJson));
532+
if (isSession)
533+
{
534+
_cacheManager.RemoveCachedSession(id);
535+
}
536+
else
537+
{
538+
_cacheManager.RemoveCachedEvent(id);
539+
}
532540
continue;
533541
}
534542

535543
if (isSession)
536544
{
537-
Deliver(new SessionReport(_configuration, payloadDictionary));
545+
SessionReport sessionReport = null;
546+
try
547+
{
548+
sessionReport = new SessionReport(_configuration, payloadDictionary);
549+
}
550+
catch
551+
{
552+
// this will be internally reported in a future update
553+
_cacheManager.RemoveCachedSession(id);
554+
continue;
555+
}
556+
Deliver(sessionReport);
538557
}
539558
else
540559
{
541-
Deliver(new Report(_configuration, payloadDictionary));
560+
Report report = null;
561+
try
562+
{
563+
report = new Report(_configuration, payloadDictionary);
564+
}
565+
catch
566+
{
567+
// this will be internally reported in a future update
568+
_cacheManager.RemoveCachedEvent(id);
569+
continue;
570+
}
571+
Deliver(report);
542572
}
543573

544574
yield return new WaitUntil(() => CachedPayloadProcessed(id));

0 commit comments

Comments
 (0)