Skip to content

Commit cddcbc4

Browse files
committed
Merge branch 'main' into feat/config-window-tabs
2 parents 2603a43 + b63aa7b commit cddcbc4

23 files changed

+306
-35
lines changed

.github/workflows/ios-smoke-test-compile.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ jobs:
3131

3232
- name: iOS smoke test
3333
run: ./scripts/smoke-test-ios.ps1 Build -IsIntegrationTest -UnityVersion "${{ inputs.unity-version }}" -iOSMinVersion "16.1"
34-
timeout-minutes: 10
34+
timeout-minutes: 20
3535

3636
- name: Upload integration-test project on failure
3737
if: ${{ failure() }}

CHANGELOG.md

Lines changed: 14 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -8,28 +8,29 @@
88

99
### Features
1010

11+
- The trace used to connect errors on different layers of your game now gets regenerated every time the app gains focus again, or the active scene changes ([#2123](https://github.com/getsentry/sentry-unity/pull/2123))
12+
- The SDK now links errors and events (managed and native errors) via `trace ID`. This allows you to correlate events captured from different layers of your game ([#1997](https://github.com/getsentry/sentry-unity/pull/1997), [#2089](https://github.com/getsentry/sentry-unity/pull/2089), [#2106](https://github.com/getsentry/sentry-unity/pull/2106))
1113
- Drastically improved performance of scope sync when targeting Android ([#2107](https://github.com/getsentry/sentry-unity/pull/2107))
12-
- When running on Android, Windows or Linux, the SDK now links errors and events originating on different layers (managed, native errors) via `trace ID` ([#1997](https://github.com/getsentry/sentry-unity/pull/1997), [#2089](https://github.com/getsentry/sentry-unity/pull/2089))
1314
- The SDK now reports the game's name as part of the app context ([2083](https://github.com/getsentry/sentry-unity/pull/2083))
1415
- The SDK now reports the active scene's name as part of the `Unity Context` ([2084](https://github.com/getsentry/sentry-unity/pull/2084))
1516

1617
### Dependencies
1718

18-
- Bump Cocoa SDK from v8.45.0 to v8.49.0 ([#2063](https://github.com/getsentry/sentry-unity/pull/2063), [#2071](https://github.com/getsentry/sentry-unity/pull/2071), [#2105](https://github.com/getsentry/sentry-unity/pull/2105))
19-
- [changelog](https://github.com/getsentry/sentry-cocoa/blob/main/CHANGELOG.md#8490)
20-
- [diff](https://github.com/getsentry/sentry-cocoa/compare/8.45.0...8.49.0)
21-
- Bump Java SDK from v8.3.0 to v8.8.0 ([#2066](https://github.com/getsentry/sentry-unity/pull/2066), [#2075](https://github.com/getsentry/sentry-unity/pull/2075), [#2092](https://github.com/getsentry/sentry-unity/pull/2092), [#2103](https://github.com/getsentry/sentry-unity/pull/2103), [#2111](https://github.com/getsentry/sentry-unity/pull/2111))
22-
- [changelog](https://github.com/getsentry/sentry-java/blob/main/CHANGELOG.md#880)
23-
- [diff](https://github.com/getsentry/sentry-java/compare/8.3.0...8.8.0)
19+
- Bump Cocoa SDK from v8.45.0 to v8.49.1 ([#2063](https://github.com/getsentry/sentry-unity/pull/2063), [#2071](https://github.com/getsentry/sentry-unity/pull/2071), [#2105](https://github.com/getsentry/sentry-unity/pull/2105), [#2106](https://github.com/getsentry/sentry-unity/pull/2106))
20+
- [changelog](https://github.com/getsentry/sentry-cocoa/blob/main/CHANGELOG.md#8491)
21+
- [diff](https://github.com/getsentry/sentry-cocoa/compare/8.45.0...8.49.1)
22+
- Bump Java SDK from v8.3.0 to v8.9.0 ([#2066](https://github.com/getsentry/sentry-unity/pull/2066), [#2075](https://github.com/getsentry/sentry-unity/pull/2075), [#2092](https://github.com/getsentry/sentry-unity/pull/2092), [#2103](https://github.com/getsentry/sentry-unity/pull/2103), [#2111](https://github.com/getsentry/sentry-unity/pull/2111), [#2125](https://github.com/getsentry/sentry-unity/pull/2125))
23+
- [changelog](https://github.com/getsentry/sentry-java/blob/main/CHANGELOG.md#890)
24+
- [diff](https://github.com/getsentry/sentry-java/compare/8.3.0...8.9.0)
2425
- Bump CLI from v2.42.2 to v2.43.0 ([#2065](https://github.com/getsentry/sentry-unity/pull/2065), [#2082](https://github.com/getsentry/sentry-unity/pull/2082), [#2085](https://github.com/getsentry/sentry-unity/pull/2085))
2526
- [changelog](https://github.com/getsentry/sentry-cli/blob/master/CHANGELOG.md#2430)
2627
- [diff](https://github.com/getsentry/sentry-cli/compare/2.42.2...2.43.0)
27-
- Bump .NET SDK from v5.2.0 to v5.5.1 ([#2067](https://github.com/getsentry/sentry-unity/pull/2067), [#2093](https://github.com/getsentry/sentry-unity/pull/2093), [#2102](https://github.com/getsentry/sentry-unity/pull/2102))
28-
- [changelog](https://github.com/getsentry/sentry-dotnet/blob/main/CHANGELOG.md#551)
29-
- [diff](https://github.com/getsentry/sentry-dotnet/compare/5.2.0...5.5.1)
30-
- Bump Native SDK from v0.8.1 to v0.8.3 ([#2077](https://github.com/getsentry/sentry-unity/pull/2077), [#2087](https://github.com/getsentry/sentry-unity/pull/2087))
31-
- [changelog](https://github.com/getsentry/sentry-native/blob/master/CHANGELOG.md#083)
32-
- [diff](https://github.com/getsentry/sentry-native/compare/0.8.1...0.8.3)
28+
- Bump .NET SDK from v5.2.0 to v5.6.0 ([#2067](https://github.com/getsentry/sentry-unity/pull/2067), [#2093](https://github.com/getsentry/sentry-unity/pull/2093), [#2102](https://github.com/getsentry/sentry-unity/pull/2102), [#2126](https://github.com/getsentry/sentry-unity/pull/2126))
29+
- [changelog](https://github.com/getsentry/sentry-dotnet/blob/main/CHANGELOG.md#560)
30+
- [diff](https://github.com/getsentry/sentry-dotnet/compare/5.2.0...5.6.0)
31+
- Bump Native SDK from v0.8.1 to v0.8.4 ([#2077](https://github.com/getsentry/sentry-unity/pull/2077), [#2087](https://github.com/getsentry/sentry-unity/pull/2087), [#2117](https://github.com/getsentry/sentry-unity/pull/2117))
32+
- [changelog](https://github.com/getsentry/sentry-native/blob/master/CHANGELOG.md#084)
33+
- [diff](https://github.com/getsentry/sentry-native/compare/0.8.1...0.8.4)
3334

3435
## 3.1.0
3536

Directory.Build.targets

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -571,10 +571,19 @@ void PrintFailedTests(XElement element)
571571
<!-- Checks if the environment variable 'SENTRY_AUTH_TOKEN' has been set and creates the SentryCliOptions.asset for the sample project
572572
This is meant for developers - so they don't have to configure the CLI options after each clean checkout (or git clean).
573573
Gets automatically run after 'DownloadNativeSDKs'
574-
dotnet msbuild /t:SetupSampleSentryCliOptions src/Sentry.Unity -->
575-
<Target Name="SetupSampleSentryCliOptions" AfterTargets="DownloadNativeSDKs" Condition="'$(MSBuildProjectName)' == 'Sentry.Unity' AND '$(SENTRY_AUTH_TOKEN)' != ''">
574+
dotnet msbuild /t:SamplesSetupCliOptions src/Sentry.Unity -->
575+
<Target Name="SamplesSetupCliOptions" AfterTargets="DownloadNativeSDKs" Condition="'$(MSBuildProjectName)' == 'Sentry.Unity' AND '$(SENTRY_AUTH_TOKEN)' != ''">
576576
<Message Importance="High" Text="Found environment variable 'SENTRY_AUTH_TOKEN'. Creating Sentry CLI options for sample project. " />
577-
<Exec Command="pwsh &quot;$(RepoRoot)scripts/create-sentry-cli-options.ps1&quot;"/>
577+
<Exec Command="pwsh &quot;$(RepoRoot)scripts/samples-setup-cli-options.ps1&quot;"/>
578+
</Target>
579+
580+
<!-- Checks if the environment variable 'APPLE_ID' has been set and modifies the ProjectSettings.asset for the sample project
581+
This is meant for developers - so they don't have to configure the playersettings after each clean checkout (or git clean).
582+
Gets automatically run after 'SamplesSetupCliOptions'
583+
dotnet msbuild /t:SamplesSetupAppleId src/Sentry.Unity -->
584+
<Target Name="SamplesSetupAppleId" AfterTargets="SetupSampleSentryCliOptions" Condition="'$(MSBuildProjectName)' == 'Sentry.Unity' AND '$(APPLE_ID)' != ''">
585+
<Message Importance="High" Text="Found environment variable 'APPLE_ID'. Setting Apple ID for sample project. " />
586+
<Exec Command="pwsh &quot;$(RepoRoot)scripts/samples-setup-apple-id.ps1&quot;"/>
578587
</Target>
579588

580589
<!-- Downloads native SDKs from the latest successful GitHub Actions workflow run.

modules/sentry-cocoa.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
version = 8.49.0
1+
version = 8.49.1
22
repo = https://github.com/getsentry/sentry-cocoa

modules/sentry-java

Submodule sentry-java updated 44 files

package-dev/Plugins/iOS/SentryNativeBridge.m

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,11 @@ int SentryNativeBridgeStartWithOptions(const void *options)
4646
return 1;
4747
}
4848

49+
void SentryNativeBridgeSetSdkName()
50+
{
51+
[PrivateSentrySDKOnly performSelector:@selector(setSdkName:) withObject:@"sentry.cocoa.unity"];
52+
}
53+
4954
int SentryNativeBridgeCrashedLastRun() { return [SentrySDK crashedLastRun] ? 1 : 0; }
5055

5156
void SentryNativeBridgeClose() { [SentrySDK close]; }
@@ -169,6 +174,29 @@ void SentryNativeBridgeUnsetUser()
169174
return cString;
170175
}
171176

177+
void SentryNativeBridgeSetTrace(const char *traceId, const char *spanId)
178+
{
179+
if (traceId == NULL || spanId == NULL) {
180+
return;
181+
}
182+
183+
NSString *traceIdStr = [NSString stringWithUTF8String:traceId];
184+
NSString *spanIdStr = [NSString stringWithUTF8String:spanId];
185+
186+
// This is a workaround to deal with SentryId living inside the Swift header
187+
Class sentryIdClass = NSClassFromString(@"_TtC6Sentry8SentryId");
188+
Class sentrySpanIdClass = NSClassFromString(@"SentrySpanId");
189+
190+
if (sentryIdClass && sentrySpanIdClass) {
191+
id sentryTraceId = [[sentryIdClass alloc] initWithUUIDString:traceIdStr];
192+
id sentrySpanId = [[sentrySpanIdClass alloc] initWithValue:spanIdStr];
193+
194+
if (sentryTraceId && sentrySpanId) {
195+
[PrivateSentrySDKOnly setTrace:sentryTraceId spanId:sentrySpanId];
196+
}
197+
}
198+
}
199+
172200
static inline NSString *_NSStringOrNil(const char *value)
173201
{
174202
return value ? [NSString stringWithUTF8String:value] : nil;

package-dev/Plugins/iOS/SentryNativeBridgeNoOp.m

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@ void SentryNativeBridgeOptionsSetString(void *options, const char *name, const c
88
void SentryNativeBridgeOptionsSetInt(void *options, const char *name, int32_t value) { }
99
int SentryNativeBridgeStartWithOptions(void *options) { return 0; }
1010

11+
void SentryNativeBridgeSetSdkName() { }
12+
1113
int SentryNativeBridgeCrashedLastRun() { return 0; }
1214

1315
void SentryNativeBridgeClose() { }
@@ -28,6 +30,8 @@ void SentryNativeBridgeUnsetUser() { }
2830

2931
char *SentryNativeBridgeGetInstallationId() { return NULL; }
3032

33+
void SentryNativeBridgeSetTrace(const char *traceId, const char *spanId) { }
34+
3135
void SentryNativeBridgeWriteScope( // clang-format off
3236
// // const char *AppStartTime,
3337
// const char *AppBuildType,

package-dev/Plugins/macOS/SentryNativeBridge.m

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@
88
static Class SentryBreadcrumb;
99
static Class SentryUser;
1010
static Class SentryOptions;
11+
static Class SentryId;
12+
static Class SentrySpanId;
1113
static Class PrivateSentrySDKOnly;
1214

1315
#define LOAD_CLASS_OR_BREAK(name) \
@@ -17,6 +19,13 @@
1719
break; \
1820
}
1921

22+
#define LOAD_SWIFT_CLASS_OR_BREAK(name, mangled_name) \
23+
name = (__bridge Class)dlsym(dylib, "OBJC_CLASS_$_" #mangled_name); \
24+
if (!name) { \
25+
NSLog(@"Sentry (bridge): Couldn't load class '" #name "' from the dynamic library"); \
26+
break; \
27+
}
28+
2029
// Returns (bool): 0 on failure, 1 on success
2130
// WARNING: you may only call other Sentry* functions AFTER calling this AND only if it returned "1"
2231
int SentryNativeBridgeLoadLibrary()
@@ -40,6 +49,8 @@ int SentryNativeBridgeLoadLibrary()
4049
LOAD_CLASS_OR_BREAK(SentryBreadcrumb)
4150
LOAD_CLASS_OR_BREAK(SentryUser)
4251
LOAD_CLASS_OR_BREAK(SentryOptions)
52+
LOAD_SWIFT_CLASS_OR_BREAK(SentryId, _TtC6Sentry8SentryId)
53+
LOAD_CLASS_OR_BREAK(SentrySpanId)
4354
LOAD_CLASS_OR_BREAK(PrivateSentrySDKOnly)
4455

4556
// everything above passed - mark as successfully loaded
@@ -112,6 +123,11 @@ void SentryConfigureScope(void (^callback)(id))
112123
/* - use [obj setValue:value forKey:@"prop"] instead of `obj.prop = value` */
113124
/*******************************************************************************/
114125

126+
void SentryNativeBridgeSetSdkName()
127+
{
128+
[PrivateSentrySDKOnly performSelector:@selector(setSdkName:) withObject:@"sentry.cocoa.unity"];
129+
}
130+
115131
int SentryNativeBridgeCrashedLastRun()
116132
{
117133
@try {
@@ -263,6 +279,26 @@ void SentryNativeBridgeUnsetUser()
263279
return cString;
264280
}
265281

282+
void SentryNativeBridgeSetTrace(const char *traceId, const char *spanId)
283+
{
284+
if (traceId == NULL || spanId == NULL) {
285+
return;
286+
}
287+
288+
id sentryTraceId = [[SentryId alloc]
289+
performSelector:@selector(initWithUUIDString:)
290+
withObject:[NSString stringWithUTF8String:traceId]];
291+
292+
id sentrySpanId = [[SentrySpanId alloc]
293+
performSelector:@selector(initWithValue:)
294+
withObject:[NSString stringWithUTF8String:spanId]];
295+
296+
[PrivateSentrySDKOnly
297+
performSelector:@selector(setTrace:spanId:)
298+
withObject:sentryTraceId
299+
withObject:sentrySpanId];
300+
}
301+
266302
static inline NSString *_NSStringOrNil(const char *value)
267303
{
268304
return value ? [NSString stringWithUTF8String:value] : nil;

scripts/ci-env.ps1

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,13 +14,13 @@ switch ($name) {
1414
return "2021.3.45f1"
1515
}
1616
"unity2022" {
17-
return "2022.3.60f1"
17+
return "2022.3.61f1"
1818
}
1919
"unity2023" {
2020
return "2023.2.20f1"
2121
}
2222
"unity6000" {
23-
return "6000.0.46f1"
23+
return "6000.0.47f1"
2424
}
2525
Default {
2626
throw "Unkown variable '$name'"

0 commit comments

Comments
 (0)