Skip to content

Commit f0aa58b

Browse files
authored
Merge pull request #682 from bugsnag/integration/codeFreezeBugFixes
bug fixes made during 2022 code freeze πŸŽ…
2 parents f0d2d39 + 78407d7 commit f0aa58b

26 files changed

+222
-209
lines changed

β€ŽCHANGELOG.mdβ€Ž

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

3-
## TBD
4-
5-
- Update bugsnag-cocoa from v6.25.0 to [v6.25.1](https://github.com/bugsnag/bugsnag-cocoa/blob/master/CHANGELOG.md#6251-2022-12-07)
6-
7-
## 7.5.0 (2022-11-30)
3+
## 7.5.0 (2023-01-04)
84

95
### Enhancements
106

7+
* Added checks in delivery to ensure payloads can't get stuck in a retry loop. [#683](https://github.com/bugsnag/bugsnag-unity/pull/683)
8+
119
* Raised `Configuration.MaxBreadcrumbs` default from 50 to 100, raised the limit from 100 to 500 and added a check to truncate breadcrumbs from oversized payloads. [#671](https://github.com/bugsnag/bugsnag-unity/pull/671)
1210

1311
* Add `Configuration.MaxStringValueLength` config option. [#668](https://github.com/bugsnag/bugsnag-unity/pull/668)
@@ -16,7 +14,7 @@
1614

1715
### Dependency updates
1816

19-
* Update bugsnag-cocoa from v6.24.0 to [v6.25.0](https://github.com/bugsnag/bugsnag-cocoa/blob/master/CHANGELOG.md#6240-2022-10-05)
17+
* Update bugsnag-cocoa from v6.25.0 to [v6.25.1](https://github.com/bugsnag/bugsnag-cocoa/blob/master/CHANGELOG.md#6251-2022-12-07)
2018
* Update bugsnag-android from v5.28.1 to [v5.28.3](https://github.com/bugsnag/bugsnag-android/blob/master/CHANGELOG.md#5283-2022-11-16)
2119

2220
### Bug fixes
@@ -27,6 +25,12 @@
2725

2826
* Fix an issue where android metadata was not deserialised as the correct type, which could cause exceptions when processing metadata. [#652](https://github.com/bugsnag/bugsnag-unity/pull/652)
2927

28+
* Fix an issue where android sessions had inaccurate Session.Handled and Unhandled counts. [#684](https://github.com/bugsnag/bugsnag-unity/pull/684)
29+
30+
* Fix an issue where Cocoa Device and App data was serialized incorrectly causing invalid cast exceptions in callbacks [#680](https://github.com/bugsnag/bugsnag-unity/pull/680)
31+
32+
* Fixed an issue where user changes made in OnSession callbacks did not make it to the generated payload [#681](https://github.com/bugsnag/bugsnag-unity/pull/681)
33+
3034
## 7.4.0 (2022-10-26)
3135

3236
### Dependency updates

β€ŽGemfileβ€Ž

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ gem 'xcodeproj'
66

77
unless Gem.win_platform?
88
# Use official Maze Runner release
9-
gem 'bugsnag-maze-runner', git: 'https://github.com/bugsnag/maze-runner', tag: 'v7.2.1'
9+
gem 'bugsnag-maze-runner', git: 'https://github.com/bugsnag/maze-runner', tag: 'v7.10.1'
1010

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

β€Žfeatures/csharp/csharp_callbacks.featureβ€Ž

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,13 +53,11 @@ Feature: Callbacks
5353
And the exception "message" equals "Error 1"
5454
And all possible parameters have been edited in a callback
5555

56-
@skip_windows @skip_webgl #Pending PLAT-9130
5756
Scenario: Session callbacks in config
5857
When I run the game in the "OnSessionInConfig" state
5958
And I wait to receive 1 session
6059
And all possible parameters have been edited in a session callback
6160

62-
@skip_windows @skip_webgl #Pending PLAT-9130
6361
Scenario: Session callbacks in config
6462
When I run the game in the "OnSessionAfterStart" state
6563
And I wait to receive 1 session

β€Žfeatures/csharp/csharp_config.featureβ€Ž

Lines changed: 0 additions & 54 deletions
Original file line numberDiff line numberDiff line change
@@ -3,64 +3,13 @@ Feature: csharp events
33
Background:
44
Given I clear the Bugsnag cache
55

6-
#IS LAUNCHING SECTION --------------------------------------------------------------------
7-
# These duplicate isLaunching tests will be merged after the bug PLAT-9060 is fixed
8-
#macos tests to accommodate bug
9-
@cocoa_only
10-
Scenario: Launch duration set to 0
11-
When I run the game in the "InfiniteLaunchDuration" state
12-
And I wait to receive an error
13-
Then the error is valid for the error reporting API sent by the Unity notifier
14-
And the exception "message" equals "InfiniteLaunchDuration"
15-
And the event "app.isLaunching" equals "true"
16-
17-
@cocoa_only
18-
Scenario: Call mark launch complete
19-
When I run the game in the "MarkLaunchComplete" state
20-
And I wait to receive 2 errors
21-
And I sort the errors by the payload field "events.0.exceptions.0.message"
22-
Then the error is valid for the error reporting API sent by the Unity notifier
23-
And the exception "message" equals "Error 1"
24-
And the event "app.isLaunching" equals "true"
25-
And I discard the oldest error
26-
And the exception "message" equals "Error 2"
27-
And the event "app.isLaunching" equals "false"
28-
29-
@cocoa_only
30-
Scenario: Set long launch time
31-
When I run the game in the "LongLaunchTime" state
32-
And I wait to receive 2 errors
33-
And I sort the errors by the payload field "events.0.exceptions.0.message"
34-
Then the error is valid for the error reporting API sent by the Unity notifier
35-
And the exception "message" equals "Error 1"
36-
And the event "app.isLaunching" equals "true"
37-
And I discard the oldest error
38-
And the exception "message" equals "Error 2"
39-
And the event "app.isLaunching" equals "false"
40-
41-
@cocoa_only
42-
Scenario: Set short launch time
43-
When I run the game in the "ShortLaunchTime" state
44-
And I wait to receive 2 errors
45-
And I sort the errors by the payload field "events.0.exceptions.0.message"
46-
Then the error is valid for the error reporting API sent by the Unity notifier
47-
And the exception "message" equals "Error 1"
48-
And the event "app.isLaunching" equals "true"
49-
And I discard the oldest error
50-
And the exception "message" equals "Error 2"
51-
And the event "app.isLaunching" equals "false"
52-
53-
54-
#Correct tests to be enabled when PLAT-9061 is fixed
55-
@skip_cocoa
566
Scenario: Launch duration set to 0
577
When I run the game in the "InfiniteLaunchDuration" state
588
And I wait to receive an error
599
Then the error is valid for the error reporting API sent by the Unity notifier
6010
And the exception "message" equals "InfiniteLaunchDuration"
6111
And the event "app.isLaunching" is true
6212

63-
@skip_cocoa
6413
Scenario: Call mark launch complete
6514
When I run the game in the "MarkLaunchComplete" state
6615
And I wait to receive 2 errors
@@ -96,9 +45,6 @@ Feature: csharp events
9645
And the exception "message" equals "Error 2"
9746
And the event "app.isLaunching" is false
9847

99-
100-
#END SECTION -----------------------------------------------------------------------------
101-
10248
Scenario: Auto notify false
10349
When I run the game in the "AutoNotifyFalse" state
10450
And I should receive no errors

β€Žfeatures/csharp/csharp_persistence.featureβ€Ž

Lines changed: 30 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,11 @@ Feature: Unity Persistence
55

66
@skip_windows @skip_macos @skip_webgl #pending PLAT-8632
77
Scenario: Receive a persisted session
8-
When I run the game in the "PersistSession" state
9-
And I wait for requests to fail
8+
When I set the HTTP status code for the next requests to "408"
9+
And I run the game in the "PersistSession" state
10+
And I wait to receive 1 session
11+
And I wait for requests to persist
12+
And I discard the oldest session
1013
And I close the Unity app
1114
And On Mobile I relaunch the app
1215
And I run the game in the "PersistSessionReport" state
@@ -18,8 +21,11 @@ Feature: Unity Persistence
1821
And the session payload field "app.releaseStage" equals "Session 2"
1922

2023
Scenario: Receive a persisted event
21-
When I run the game in the "PersistEvent" state
22-
And I wait for requests to fail
24+
When I set the HTTP status code for the next requests to "408"
25+
And I run the game in the "PersistEvent" state
26+
And I wait to receive an error
27+
And I wait for requests to persist
28+
And I discard the oldest error
2329
And I close the Unity app
2430
And On Mobile I relaunch the app
2531
And I run the game in the "PersistEventReport" state
@@ -32,8 +38,11 @@ Feature: Unity Persistence
3238
And the exception "message" equals "Error 2"
3339

3440
Scenario: Receive a persisted event with on send callback
35-
When I run the game in the "PersistEvent" state
36-
And I wait for requests to fail
41+
When I set the HTTP status code for the next requests to "408"
42+
And I run the game in the "PersistEvent" state
43+
And I wait to receive an error
44+
And I wait for requests to persist
45+
And I discard the oldest error
3746
And I close the Unity app
3847
And On Mobile I relaunch the app
3948
And I run the game in the "PersistEventReportCallback" state
@@ -49,8 +58,14 @@ Feature: Unity Persistence
4958
And the event "metaData.Persist Section.Persist Key" equals "Persist Value"
5059

5160
Scenario: Max Persisted Events
61+
When I set the HTTP status code for the next requests to "408,408,408,408"
5262
When I run the game in the "MaxPersistEvents" state
53-
And I wait for requests to fail
63+
And I wait to receive 4 errors
64+
And I wait for requests to persist
65+
And I discard the oldest error
66+
And I discard the oldest error
67+
And I discard the oldest error
68+
And I discard the oldest error
5469
And I close the Unity app
5570
And On Mobile I relaunch the app
5671
And I run the game in the "ReportMaxPersistedEvents" state
@@ -59,8 +74,14 @@ Feature: Unity Persistence
5974

6075
@skip_cocoa @skip_android #These platforms handle sessions separately and will have separate tests
6176
Scenario: Max Persisted Sessions
62-
When I run the game in the "MaxPersistSessions" state
63-
And I wait for requests to fail
77+
When I set the HTTP status code for the next requests to "408,408,408,408"
78+
And I run the game in the "MaxPersistSessions" state
79+
And I wait to receive 4 sessions
80+
And I wait for requests to persist
81+
And I discard the oldest session
82+
And I discard the oldest session
83+
And I discard the oldest session
84+
And I discard the oldest session
6485
And I close the Unity app
6586
And On Mobile I relaunch the app
6687
And I run the game in the "ReportMaxPersistedSessions" state

β€Žfeatures/csharp/csharp_sessions.featureβ€Ž

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,6 @@ Feature: Session Tracking
9898
And the session "user.email" is null
9999
And the session "user.name" is null
100100

101-
@skip_android #pending PLAT-9086
102101
Scenario: Multiple event counts in one session
103102
When I run the game in the "MultipleEventCounts" state
104103
And I wait to receive a session
@@ -124,7 +123,6 @@ Feature: Session Tracking
124123
And the exception "message" equals "PausedSessionEvent"
125124
And the event "session" is null
126125

127-
@skip_android #pending PLAT-9086
128126
Scenario: When a session is resumed the error uses the previous session information
129127
When I run the game in the "ResumedSession" state
130128
And I wait to receive a session
@@ -146,7 +144,6 @@ Feature: Session Tracking
146144
And the error payload field "session.startedAt" equals the stored value "session_startedAt"
147145
And the error payload field "events.0.session.events.handled" equals 2
148146

149-
@skip_android #pending PLAT-9086
150147
Scenario: When a new session is started the error uses different session information
151148
When I run the game in the "NewSession" state
152149
And I wait to receive 2 sessions

β€Žfeatures/fixtures/maze_runner/Assets/Scripts/Scenario.csβ€Ž

Lines changed: 42 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -115,11 +115,6 @@ public void AddTestingFeatureFlags()
115115
Bugsnag.ClearFeatureFlag("flag2");
116116
}
117117

118-
public void SetInvalidEndpoints()
119-
{
120-
Configuration.Endpoints = new EndpointConfiguration("https://notify.def-not-bugsnag.com", "https://notify.def-not-bugsnag.com");
121-
}
122-
123118
public bool SimpleEventCallback(IEvent @event)
124119
{
125120
EditAllAppData(@event);
@@ -216,29 +211,71 @@ public bool CocoaNativeEventCallback(IEvent @event)
216211

217212
private void EditAllAppData(IEvent @event)
218213
{
214+
215+
// the unused vars for each property and there to check that the stored payload (retrieved from the native layers) contains the correct types
216+
// if the incorrect type is stored then we will get an InvalidCast Exception
217+
218+
string binaryArch = @event.App.BinaryArch;
219219
@event.App.BinaryArch = "BinaryArch";
220+
221+
string bundleVersion = @event.App.BundleVersion;
220222
@event.App.BundleVersion = "BundleVersion";
223+
224+
string codeBundleId = @event.App.CodeBundleId;
221225
@event.App.CodeBundleId = "CodeBundleId";
226+
227+
string dsymUuid = @event.App.DsymUuid;
222228
@event.App.DsymUuid = "DsymUuid";
229+
230+
string id = @event.App.Id;
223231
@event.App.Id = "Id";
232+
233+
string releaseStage = @event.App.ReleaseStage;
224234
@event.App.ReleaseStage = "ReleaseStage";
235+
236+
string type = @event.App.Type;
225237
@event.App.Type = "Type";
238+
239+
string version = @event.App.Version;
226240
@event.App.Version = "Version";
241+
242+
bool? inForeground = @event.App.InForeground;
227243
@event.App.InForeground = false;
244+
245+
bool? isLaunching = @event.App.IsLaunching;
228246
@event.App.IsLaunching = false;
229247
}
230248

231249
private void EditAllDeviceData(IEvent @event)
232250
{
251+
string version = @event.Device.Id;
233252
@event.Device.Id = "Id";
253+
254+
bool? jailBroken = @event.Device.Jailbroken;
234255
@event.Device.Jailbroken = true;
256+
257+
string locale = @event.Device.Locale;
235258
@event.Device.Locale = "Locale";
259+
260+
string manufacturer = @event.Device.Manufacturer;
236261
@event.Device.Manufacturer = "Manufacturer";
262+
263+
string model = @event.Device.Model;
237264
@event.Device.Model = "Model";
265+
266+
string osName = @event.Device.OsName;
238267
@event.Device.OsName = "OsName";
268+
269+
string osVersion = @event.Device.OsVersion;
239270
@event.Device.OsVersion = "OsVersion";
271+
272+
long? freeDisk = @event.Device.FreeDisk;
240273
@event.Device.FreeDisk = 123;
274+
275+
long? freeMemory = @event.Device.FreeMemory;
241276
@event.Device.FreeMemory = 456;
277+
278+
string orientation = @event.Device.Orientation;
242279
@event.Device.Orientation = "Orientation";
243280
}
244281

β€Žfeatures/fixtures/maze_runner/Assets/Scripts/Scenarios/Csharp/Persistence/MaxPersistEvents.csβ€Ž

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@ public class MaxPersistEvents : Scenario
88
public override void PrepareConfig(string apiKey, string host)
99
{
1010
base.PrepareConfig(apiKey, host);
11-
SetInvalidEndpoints();
1211
Configuration.MaxPersistedEvents = 3;
12+
Configuration.AutoTrackSessions = false;
1313
if (Application.platform == RuntimePlatform.IPhonePlayer)
1414
{
1515
Configuration.EnabledErrorTypes.OOMs = false;

β€Žfeatures/fixtures/maze_runner/Assets/Scripts/Scenarios/Csharp/Persistence/MaxPersistSessions.csβ€Ž

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@ public class MaxPersistSessions : Scenario
88
public override void PrepareConfig(string apiKey, string host)
99
{
1010
base.PrepareConfig(apiKey, host);
11-
SetInvalidEndpoints();
1211
Configuration.MaxPersistedSessions = 3;
1312
Configuration.AutoTrackSessions = false;
1413
}

β€Žfeatures/fixtures/maze_runner/Assets/Scripts/Scenarios/Csharp/Persistence/PersistEvent.csβ€Ž

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@ public class PersistEvent : Scenario
55
public override void PrepareConfig(string apiKey, string host)
66
{
77
base.PrepareConfig(apiKey, host);
8-
SetInvalidEndpoints();
98
Configuration.Context = "Error 1";
9+
Configuration.AutoTrackSessions = false;
1010
if (Application.platform == RuntimePlatform.IPhonePlayer)
1111
{
1212
Configuration.EnabledErrorTypes.OOMs = false;

0 commit comments

Comments
Β (0)