Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PLAT-12012 fix for incorrect ios device metadata #791

Merged
merged 6 commits into from
Apr 18, 2024
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
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
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# Changelog

## TBD

### Bug Fixes

- Fixed issue where iOS C# events reported the incorrect value for device.osName. [#791](https://github.com/bugsnag/bugsnag-unity/pull/791)

## 7.7.3 (2024-04-11)

### Bug Fixes
Expand Down
21 changes: 20 additions & 1 deletion features/csharp/csharp_metadata.feature
Original file line number Diff line number Diff line change
Expand Up @@ -40,4 +40,23 @@ Feature: Metadata
And the event "metaData.numberArray.testKey.1" equals 2
And the event "metaData.stringArray.testKey.1" equals "2"
And the event "metaData.dictionary.foo" equals "bar"
And the event "metaData.number.testKey" equals 123
And the event "metaData.number.testKey" equals 123

# these platform specific tests are smoke tests, if os name is wrong then it's a sign that the native information has not been properly retrieved from the native layer and the unity placeholder data is being used
@ios_only
Scenario: iOS specific metadata
When I run the game in the "NotifySmokeTest" state
And I wait to receive an error
Then the error is valid for the error reporting API sent by the Unity notifier
And expected device metadata is included in the event
And expected app metadata is included in the event
And the event "device.osName" equals "iOS"

@android_only
Scenario: Android specific metadata
When I run the game in the "NotifySmokeTest" state
And I wait to receive an error
Then the error is valid for the error reporting API sent by the Unity notifier
And expected device metadata is included in the event
And expected app metadata is included in the event
And the event "device.osName" equals "android"
8 changes: 8 additions & 0 deletions features/support/env.rb
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,10 @@
end


Before('@ios_only') do |_scenario|
skip_this_scenario('Skipping scenario') unless Maze::Helper.get_current_platform == 'ios'
end

Before('@cocoa_only') do |_scenario|
skip_this_scenario('Skipping scenario') unless Maze.config.os == 'macos' || Maze::Helper.get_current_platform == 'ios'
end
Expand All @@ -53,6 +57,10 @@
skip_this_scenario("Skipping scenario") if Maze::Helper.get_current_platform == 'android'
end

Before('@android_only') do |_scenario|
skip_this_scenario('Skipping scenario') unless Maze::Helper.get_current_platform == 'android'
end


BeforeAll do
$api_key = 'a35a2a72bd230ac0aa0f52715bbdc6aa'
Expand Down
1 change: 0 additions & 1 deletion src/BugsnagUnity.m
Original file line number Diff line number Diff line change
Expand Up @@ -755,7 +755,6 @@ void bugsnag_retrieveLastRunInfo(const void *lastRuninfo, void (*callback)(const
char * bugsnag_retrieveDeviceData(const void *deviceData, void (*callback)(const void *instance, const char *key, const char *value)) {
BugsnagDeviceWithState *device = [Bugsnag.client generateDeviceWithState:BSGGetSystemInfo()];
NSDictionary *deviceDictionary = [NSDictionary dictionaryWithObjectsAndKeys:
device.freeDisk, @"freeDisk",
richardelms marked this conversation as resolved.
Show resolved Hide resolved
device.freeMemory, @"freeMemory",
device.id, @"id",
device.jailbroken ? @"true" : @"false", @"jailbroken",
Expand Down