Skip to content

Commit 13df560

Browse files
committed
Merge branch 'main' into feat/pixel-copy-api-for-screenshots
2 parents 746c5d0 + bc4be3b commit 13df560

File tree

103 files changed

+1868
-269
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

103 files changed

+1868
-269
lines changed

.craft.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ targets:
4848
maven:io.sentry:sentry-apollo:
4949
maven:io.sentry:sentry-jdbc:
5050
maven:io.sentry:sentry-graphql:
51-
# maven:io.sentry:sentry-quartz:
51+
maven:io.sentry:sentry-quartz:
5252
maven:io.sentry:sentry-android-navigation:
5353
maven:io.sentry:sentry-compose:
5454
maven:io.sentry:sentry-compose-android:

.github/workflows/agp-matrix.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ jobs:
1212
runs-on: ubuntu-latest
1313
steps:
1414
- name: Cancel Previous Runs
15-
uses: styfle/cancel-workflow-action@b173b6ec0100793626c2d9e6b90435061f4fc3e5 # pin@0.11.0
15+
uses: styfle/cancel-workflow-action@01ce38bf961b4e243a6342cbade0dbc8ba3f0432 # pin@0.12.0
1616
with:
1717
access_token: ${{ github.token }}
1818

.github/workflows/integration-tests-benchmarks.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ jobs:
4141
run: make stop
4242

4343
- name: Run All Tests in SauceLab
44-
uses: saucelabs/saucectl-run-action@52ca363cd023900b9867b49abf5791c5ab7eafa9 # pin@v3
44+
uses: saucelabs/saucectl-run-action@7fe025ef1fdc6f211add3751a6c7d8bba27ba9b1 # pin@v3
4545
if: github.event_name != 'pull_request' && env.SAUCE_USERNAME != null
4646
env:
4747
GITHUB_TOKEN: ${{ github.token }}
@@ -51,7 +51,7 @@ jobs:
5151
config-file: .sauce/sentry-uitest-android-benchmark.yml
5252

5353
- name: Run one test in SauceLab
54-
uses: saucelabs/saucectl-run-action@52ca363cd023900b9867b49abf5791c5ab7eafa9 # pin@v3
54+
uses: saucelabs/saucectl-run-action@7fe025ef1fdc6f211add3751a6c7d8bba27ba9b1 # pin@v3
5555
if: github.event_name == 'pull_request' && env.SAUCE_USERNAME != null
5656
env:
5757
GITHUB_TOKEN: ${{ github.token }}

.github/workflows/integration-tests-ui.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ jobs:
1111
runs-on: ubuntu-latest
1212
steps:
1313
- name: Cancel Previous Runs
14-
uses: styfle/cancel-workflow-action@b173b6ec0100793626c2d9e6b90435061f4fc3e5 # pin@0.11.0
14+
uses: styfle/cancel-workflow-action@01ce38bf961b4e243a6342cbade0dbc8ba3f0432 # pin@0.12.0
1515
with:
1616
access_token: ${{ github.token }}
1717

@@ -44,7 +44,7 @@ jobs:
4444
run: make stop
4545

4646
- name: Run Tests in SauceLab
47-
uses: saucelabs/saucectl-run-action@52ca363cd023900b9867b49abf5791c5ab7eafa9 # pin@v3
47+
uses: saucelabs/saucectl-run-action@7fe025ef1fdc6f211add3751a6c7d8bba27ba9b1 # pin@v3
4848
env:
4949
GITHUB_TOKEN: ${{ github.token }}
5050
with:

.sauce/sentry-uitest-android-benchmark.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ suites:
4242
useTestOrchestrator: true
4343
devices:
4444
- id: Google_Pixel_3a_XL_real # Google Pixel 3a XL - api 29 (10)
45-
- id: Samsung_Galaxy_A10e_real_us # Samsung Galaxy A10e - api 29 (10)
45+
- id: Motorola_Moto_G_Power_real_us # Motorola Moto G Power - api 29 (10)
4646

4747
# At the time of writing (July, 4, 2022), the market share per android version is:
4848
# 12.0 = 17.54%, 11.0 = 31.65%, 10.0 = 21.92%

CHANGELOG.md

+46-2
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,60 @@
22

33
## Unreleased
44

5+
### Fixes
6+
7+
- Fix crash when HTTP connection error message contains formatting symbols ([#3002](https://github.com/getsentry/sentry-java/pull/3002))
8+
- Cap max number of stack frames to 100 to not exceed payload size limit ([#3009](https://github.com/getsentry/sentry-java/pull/3009))
9+
- This will ensure we report errors with a big number of frames such as `StackOverflowError`
10+
11+
## 6.32.0
12+
13+
### Features
14+
15+
- Make `DebugImagesLoader` public ([#2993](https://github.com/getsentry/sentry-java/pull/2993))
16+
17+
### Fixes
18+
19+
- Make `SystemEventsBroadcastReceiver` exported on API 33+ ([#2990](https://github.com/getsentry/sentry-java/pull/2990))
20+
- This will fix the `SystemEventsBreadcrumbsIntegration` crashes that you might have encountered on Play Console
21+
22+
## 6.31.0
23+
524
### Features
625

26+
- Improve default debouncing mechanism ([#2945](https://github.com/getsentry/sentry-java/pull/2945))
727
- Add `CheckInUtils.withCheckIn` which abstracts away some of the manual check-ins complexity ([#2959](https://github.com/getsentry/sentry-java/pull/2959))
28+
- Add `@SentryCaptureExceptionParameter` annotation which captures exceptions passed into an annotated method ([#2764](https://github.com/getsentry/sentry-java/pull/2764))
29+
- This can be used to replace `Sentry.captureException` calls in `@ExceptionHandler` of a `@ControllerAdvice`
30+
- Add `ServerWebExchange` to `Hint` for WebFlux as `WEBFLUX_EXCEPTION_HANDLER_EXCHANGE` ([#2977](https://github.com/getsentry/sentry-java/pull/2977))
31+
- Allow filtering GraphQL errors ([#2967](https://github.com/getsentry/sentry-java/pull/2967))
32+
- This list can be set directly when calling the constructor of `SentryInstrumentation`
33+
- For Spring Boot it can also be set in `application.properties` as `sentry.graphql.ignored-error-types=SOME_ERROR,ANOTHER_ERROR`
34+
35+
### Fixes
36+
37+
- Add OkHttp span auto-close when response body is not read ([#2923](https://github.com/getsentry/sentry-java/pull/2923))
38+
- Fix json parsing of nullable/empty fields for Hybrid SDKs ([#2968](https://github.com/getsentry/sentry-java/pull/2968))
39+
- (Internal) Rename `nextList` to `nextListOrNull` to actually match what the method does
40+
- (Hybrid) Check if there's any object in a collection before trying to parse it (which prevents the "Failed to deserilize object in list" log message)
41+
- (Hybrid) If a date can't be parsed as an ISO timestamp, attempts to parse it as millis silently, without printing a log message
42+
- (Hybrid) If `op` is not defined as part of `SpanContext`, fallback to an empty string, because the filed is optional in the spec
43+
- Always attach OkHttp errors and Http Client Errors only to call root span ([#2961](https://github.com/getsentry/sentry-java/pull/2961))
44+
- Fixed crash accessing Choreographer instance ([#2970](https://github.com/getsentry/sentry-java/pull/2970))
45+
46+
### Dependencies
47+
48+
- Bump Native SDK from v0.6.5 to v0.6.6 ([#2975](https://github.com/getsentry/sentry-java/pull/2975))
49+
- [changelog](https://github.com/getsentry/sentry-native/blob/master/CHANGELOG.md#066)
50+
- [diff](https://github.com/getsentry/sentry-native/compare/0.6.5...0.6.6)
51+
- Bump Gradle from v8.3.0 to v8.4.0 ([#2966](https://github.com/getsentry/sentry-java/pull/2966))
52+
- [changelog](https://github.com/gradle/gradle/blob/master/CHANGELOG.md#v840)
53+
- [diff](https://github.com/gradle/gradle/compare/v8.3.0...v8.4.0)
854

955
## 6.30.0
1056

1157
### Features
1258

13-
- Improve default debouncing mechanism ([#2945](https://github.com/getsentry/sentry-java/pull/2945))
1459
- Add `sendModules` option for disable sending modules ([#2926](https://github.com/getsentry/sentry-java/pull/2926))
1560
- Send `db.system` and `db.name` in span data for androidx.sqlite spans ([#2928](https://github.com/getsentry/sentry-java/pull/2928))
1661
- Check-ins (CRONS) support ([#2952](https://github.com/getsentry/sentry-java/pull/2952))
@@ -21,7 +66,6 @@
2166

2267
### Fixes
2368

24-
- Add OkHttp span auto-close when response body is not read ([#2923](https://github.com/getsentry/sentry-java/pull/2923))
2569
- Always send memory stats for transactions ([#2936](https://github.com/getsentry/sentry-java/pull/2936))
2670
- This makes it possible to query transactions by the `device.class` tag on Sentry
2771
- Add `sentry.enable-aot-compatibility` property to SpringBoot Jakarta `SentryAutoConfiguration` to enable building for GraalVM ([#2915](https://github.com/getsentry/sentry-java/pull/2915))

buildSrc/src/main/java/Config.kt

+4-4
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ object Config {
3030
}
3131

3232
object Android {
33-
private val sdkVersion = 33
33+
private val sdkVersion = 34
3434

3535
val minSdkVersion = 14
3636
val minSdkVersionOkHttp = 21
@@ -181,10 +181,10 @@ object Config {
181181
val espressoCore = "androidx.test.espresso:espresso-core:$espressoVersion"
182182
val espressoIdlingResource = "androidx.test.espresso:espresso-idling-resource:$espressoVersion"
183183
val androidxTestOrchestrator = "androidx.test:orchestrator:1.4.2"
184-
val androidxJunit = "androidx.test.ext:junit:1.1.3"
184+
val androidxJunit = "androidx.test.ext:junit:1.1.5"
185185
val androidxCoreKtx = "androidx.core:core-ktx:1.7.0"
186-
val robolectric = "org.robolectric:robolectric:4.7.3"
187-
val mockitoKotlin = "org.mockito.kotlin:mockito-kotlin:4.0.0"
186+
val robolectric = "org.robolectric:robolectric:4.10.3"
187+
val mockitoKotlin = "org.mockito.kotlin:mockito-kotlin:4.1.0"
188188
val mockitoInline = "org.mockito:mockito-inline:4.8.0"
189189
val awaitility = "org.awaitility:awaitility-kotlin:4.1.1"
190190
val mockWebserver = "com.squareup.okhttp3:mockwebserver:${Libs.okHttpVersion}"

gradle.properties

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ android.useAndroidX=true
1010
android.defaults.buildfeatures.buildconfig=true
1111

1212
# Release information
13-
versionName=6.30.0
13+
versionName=6.32.0
1414

1515
# Override the SDK name on native crashes on Android
1616
sentryAndroidSdkName=sentry.native.android

gradle/wrapper/gradle-wrapper.jar

346 Bytes
Binary file not shown.

gradle/wrapper/gradle-wrapper.properties

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
distributionBase=GRADLE_USER_HOME
22
distributionPath=wrapper/dists
3-
distributionUrl=https\://services.gradle.org/distributions/gradle-8.3-bin.zip
3+
distributionUrl=https\://services.gradle.org/distributions/gradle-8.4-bin.zip
44
networkTimeout=10000
55
validateDistributionUrl=true
66
zipStoreBase=GRADLE_USER_HOME

gradlew

+2-1
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,8 @@ done
8383
# This is normally unused
8484
# shellcheck disable=SC2034
8585
APP_BASE_NAME=${0##*/}
86-
APP_HOME=$( cd "${APP_HOME:-./}" && pwd -P ) || exit
86+
# Discard cd standard output in case $CDPATH is set (https://github.com/gradle/gradle/issues/25036)
87+
APP_HOME=$( cd "${APP_HOME:-./}" > /dev/null && pwd -P ) || exit
8788

8889
# Use the maximum available, or set MAX_FD != -1 to use that value.
8990
MAX_FD=maximum

sentry-android-core/src/main/java/io/sentry/android/core/ANRWatchDog.java

+25-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,28 @@
1-
// https://github.com/SalomonBrys/ANR-WatchDog/blob/1969075f75f5980e9000eaffbaa13b0daf282dcb/anr-watchdog/src/main/java/com/github/anrwatchdog/ANRWatchDog.java
2-
// Based on the class above. The API unnecessary here was removed.
1+
/*
2+
* Adapted from https://github.com/SalomonBrys/ANR-WatchDog/blob/1969075f75f5980e9000eaffbaa13b0daf282dcb/anr-watchdog/src/main/java/com/github/anrwatchdog/ANRWatchDog.java
3+
*
4+
* The MIT License (MIT)
5+
*
6+
* Copyright (c) 2016 Salomon BRYS
7+
*
8+
* Permission is hereby granted, free of charge, to any person obtaining a copy of
9+
* this software and associated documentation files (the "Software"), to deal in
10+
* the Software without restriction, including without limitation the rights to
11+
* use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
12+
* the Software, and to permit persons to whom the Software is furnished to do so,
13+
* subject to the following conditions:
14+
*
15+
* The above copyright notice and this permission notice shall be included in all
16+
* copies or substantial portions of the Software.
17+
*
18+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
19+
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
20+
* FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
21+
* COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
22+
* IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
23+
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
24+
*/
25+
326
package io.sentry.android.core;
427

528
import static android.app.ActivityManager.ProcessErrorStateInfo.NOT_RESPONDING;

sentry-android-core/src/main/java/io/sentry/android/core/ContextUtils.java

+32
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,15 @@
22

33
import static android.app.ActivityManager.RunningAppProcessInfo.IMPORTANCE_FOREGROUND;
44
import static android.content.Context.ACTIVITY_SERVICE;
5+
import static android.content.Context.RECEIVER_EXPORTED;
56
import static android.content.pm.PackageInfo.REQUESTED_PERMISSION_GRANTED;
67

78
import android.annotation.SuppressLint;
89
import android.app.ActivityManager;
10+
import android.content.BroadcastReceiver;
911
import android.content.Context;
12+
import android.content.Intent;
13+
import android.content.IntentFilter;
1014
import android.content.pm.ApplicationInfo;
1115
import android.content.pm.PackageInfo;
1216
import android.content.pm.PackageManager;
@@ -16,6 +20,7 @@
1620
import android.util.DisplayMetrics;
1721
import io.sentry.ILogger;
1822
import io.sentry.SentryLevel;
23+
import io.sentry.SentryOptions;
1924
import io.sentry.protocol.App;
2025
import java.io.BufferedReader;
2126
import java.io.File;
@@ -346,6 +351,33 @@ static boolean isForegroundImportance(final @NotNull Context context) {
346351
}
347352
}
348353

354+
/** Register a not exported BroadcastReceiver, independently from platform version. */
355+
static @Nullable Intent registerReceiver(
356+
final @NotNull Context context,
357+
final @NotNull SentryOptions options,
358+
final @Nullable BroadcastReceiver receiver,
359+
final @NotNull IntentFilter filter) {
360+
return registerReceiver(context, new BuildInfoProvider(options.getLogger()), receiver, filter);
361+
}
362+
363+
/** Register a not exported BroadcastReceiver, independently from platform version. */
364+
@SuppressLint({"NewApi", "UnspecifiedRegisterReceiverFlag"})
365+
static @Nullable Intent registerReceiver(
366+
final @NotNull Context context,
367+
final @NotNull BuildInfoProvider buildInfoProvider,
368+
final @Nullable BroadcastReceiver receiver,
369+
final @NotNull IntentFilter filter) {
370+
if (buildInfoProvider.getSdkInfoVersion() >= Build.VERSION_CODES.TIRAMISU) {
371+
// From https://developer.android.com/guide/components/broadcasts#context-registered-receivers
372+
// If this receiver is listening for broadcasts sent from the system or from other apps, even
373+
// other apps that you own—use the RECEIVER_EXPORTED flag. If instead this receiver is
374+
// listening only for broadcasts sent by your app, use the RECEIVER_NOT_EXPORTED flag.
375+
return context.registerReceiver(receiver, filter, RECEIVER_EXPORTED);
376+
} else {
377+
return context.registerReceiver(receiver, filter);
378+
}
379+
}
380+
349381
// we perform an if-check for that, but lint fails to recognize
350382
@SuppressLint("NewApi")
351383
static void setAppPackageInfo(

sentry-android-core/src/main/java/io/sentry/android/core/DeviceInfoUtil.java

+2-1
Original file line numberDiff line numberDiff line change
@@ -262,7 +262,8 @@ private Date getBootTime() {
262262

263263
@Nullable
264264
private Intent getBatteryIntent() {
265-
return context.registerReceiver(null, new IntentFilter(Intent.ACTION_BATTERY_CHANGED));
265+
return ContextUtils.registerReceiver(
266+
context, buildInfoProvider, null, new IntentFilter(Intent.ACTION_BATTERY_CHANGED));
266267
}
267268

268269
/**

sentry-android-core/src/main/java/io/sentry/android/core/SystemEventsBreadcrumbsIntegration.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ public void register(final @NotNull IHub hub, final @NotNull SentryOptions optio
9999
}
100100
try {
101101
// registerReceiver can throw SecurityException but it's not documented in the official docs
102-
context.registerReceiver(receiver, filter);
102+
ContextUtils.registerReceiver(context, options, receiver, filter);
103103
this.options
104104
.getLogger()
105105
.log(SentryLevel.DEBUG, "SystemEventsBreadcrumbsIntegration installed.");

sentry-android-core/src/main/java/io/sentry/android/core/internal/util/FirstDrawDoneListener.java

+18-4
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,21 @@
1+
/*
2+
* https://github.com/firebase/firebase-android-sdk/blob/master/firebase-perf/src/main/java/com/google/firebase/perf/util/FirstDrawDoneListener.java
3+
*
4+
* Copyright 2022 Google LLC
5+
*
6+
* Licensed under the Apache License, Version 2.0 (the "License");
7+
* you may not use this file except in compliance with the License.
8+
* You may obtain a copy of the License at
9+
*
10+
* http://www.apache.org/licenses/LICENSE-2.0
11+
*
12+
* Unless required by applicable law or agreed to in writing, software
13+
* distributed under the License is distributed on an "AS IS" BASIS,
14+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15+
* See the License for the specific language governing permissions and
16+
* limitations under the License.
17+
*/
18+
119
package io.sentry.android.core.internal.util;
220

321
import android.annotation.SuppressLint;
@@ -14,10 +32,6 @@
1432
/**
1533
* OnDrawListener that unregisters itself and invokes callback when the next draw is done. This API
1634
* 16+ implementation is an approximation of the initial-display-time defined by Android Vitals.
17-
*
18-
* <p>Adapted from <a
19-
* href="https://github.com/firebase/firebase-android-sdk/blob/master/firebase-perf/src/main/java/com/google/firebase/perf/util/FirstDrawDoneListener.java">Firebase</a>
20-
* under the Apache License, Version 2.0.
2135
*/
2236
@SuppressLint("ObsoleteSdkInt")
2337
@RequiresApi(api = Build.VERSION_CODES.JELLY_BEAN)

sentry-android-core/src/main/java/io/sentry/android/core/internal/util/SentryFrameMetricsCollector.java

+14-1
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,20 @@ public SentryFrameMetricsCollector(
9494
// https://cs.android.com/androidx/platform/frameworks/support/+/androidx-main:metrics/metrics-performance/src/main/java/androidx/metrics/performance/JankStatsApi24Impl.kt
9595

9696
// The Choreographer instance must be accessed on the main thread
97-
new Handler(Looper.getMainLooper()).post(() -> choreographer = Choreographer.getInstance());
97+
new Handler(Looper.getMainLooper())
98+
.post(
99+
() -> {
100+
try {
101+
choreographer = Choreographer.getInstance();
102+
} catch (Throwable e) {
103+
options
104+
.getLogger()
105+
.log(
106+
SentryLevel.ERROR,
107+
"Error retrieving Choreographer instance. Slow and frozen frames will not be reported.",
108+
e);
109+
}
110+
});
98111
// Let's get the last frame timestamp from the choreographer private field
99112
try {
100113
choreographerLastFrameTimeField = Choreographer.class.getDeclaredField("mLastFrameTimeNanos");

0 commit comments

Comments
 (0)