Skip to content

Commit 1635fe7

Browse files
committed
Merge remote-tracking branch 'origin/main' into fix/mark-dropped-app-exits-as-reported
# Conflicts: # CHANGELOG.md
2 parents 4e5f82d + ecf86ff commit 1635fe7

33 files changed

Lines changed: 1020 additions & 154 deletions

.github/workflows/changes-in-high-risk-code.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ jobs:
1919
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
2020
- name: Get changed files
2121
id: changes
22-
uses: dorny/paths-filter@7b450fff21473bca461d4b92ce414b9d0420d706 # v4.0.2
22+
uses: dorny/paths-filter@ceb8a2b8f2d89434be7ff52d3de7ec3738c5cc9d # v4.0.3
2323
with:
2424
token: ${{ github.token }}
2525
filters: .github/file-filters.yml

.github/workflows/codeql-analysis.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ jobs:
3636
cache-encryption-key: ${{ secrets.GRADLE_ENCRYPTION_KEY }}
3737

3838
- name: Initialize CodeQL
39-
uses: github/codeql-action/init@5595ccaf912efad79be6eef63a5619ff05969be3 # pin@v2
39+
uses: github/codeql-action/init@db488ddef3bf6cb639b32c2e9a7c0a7ea8271d28 # pin@v2
4040
with:
4141
languages: 'java'
4242

@@ -45,4 +45,4 @@ jobs:
4545
./gradlew buildForCodeQL --no-build-cache
4646
4747
- name: Perform CodeQL Analysis
48-
uses: github/codeql-action/analyze@5595ccaf912efad79be6eef63a5619ff05969be3 # pin@v2
48+
uses: github/codeql-action/analyze@db488ddef3bf6cb639b32c2e9a7c0a7ea8271d28 # pin@v2

.github/workflows/generate-javadocs.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ jobs:
2626
run: |
2727
./gradlew aggregateJavadocs
2828
- name: Deploy
29-
uses: JamesIves/github-pages-deploy-action@d92aa235d04922e8f08b40ce78cc5442fcfbfa2f # pin@4.8.0
29+
uses: JamesIves/github-pages-deploy-action@fa24774553152dd7873cd16ebd8d959b010c5445 # pin@4.9.0
3030
with:
3131
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
3232
BRANCH: gh-pages

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ jobs:
5757
--json-out ./artifacts/benchmarkData.json | tee -a "$GITHUB_STEP_SUMMARY"
5858
5959
- name: Upload Sauce artifacts
60-
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
60+
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
6161
if: ${{ !cancelled() }}
6262
with:
6363
name: macrobenchmark-results

.github/workflows/release.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ jobs:
3434
fetch-depth: 0
3535
submodules: 'recursive'
3636
- name: Prepare release
37-
uses: getsentry/craft@aeb16753a1764f3ef0768c03c499e3d2e4b7227c # v2
37+
uses: getsentry/craft@cd1e8294061fd970b40d98b77aaa109cb1e00e78 # v2
3838
env:
3939
GITHUB_TOKEN: ${{ steps.token.outputs.token }}
4040
with:

CHANGELOG.md

Lines changed: 22 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,16 +4,32 @@
44

55
### Fixes
66

7-
- Prevent duplicated breadcrumbs on tombstone-merged native crash events ([#5888](https://github.com/getsentry/sentry-java/pull/5888))
8-
- Prevent a class of Session Replay deadlocks by confining lifecycle state changes to Android's main thread ([#5965](https://github.com/getsentry/sentry-java/pull/5965))
9-
- Symbolicate tombstone native frames for libraries loaded directly from APKs ([#5992](https://github.com/getsentry/sentry-java/pull/5992))
107
- Keep tombstone and ANR events discarded from `beforeSend` discarded, instead of reporting them again at every app start ([#6002](https://github.com/getsentry/sentry-java/pull/6002))
118

9+
## 8.54.0
10+
1211
### Features
1312

13+
- Set `app.vitals.start.screen` and `app.vitals.start.type` on standalone `app.start` children ([#6005](https://github.com/getsentry/sentry-java/pull/6005))
1414
- Add screenshot attachment button to the Android user feedback widget ([#5828](https://github.com/getsentry/sentry-java/pull/5828))
1515
- Users can now attach a screenshot when submitting feedback. Enabled by default; can be disabled via `SentryFeedbackOptions.setEnableAttachScreenshot(false)` or the `io.sentry.feedback.enable-attach-screenshot` manifest flag.
1616
- Requires the `androidx.activity` `>=1.8.2` dependency
17+
- Add manual Session Replay controls through `Sentry.replay()` ([#5978](https://github.com/getsentry/sentry-java/pull/5978))
18+
- Explicit `start()` and `startBuffering()` calls bypass the configured replay sample rates; sampling still controls automatic startup.
19+
- `start()` starts a full-session replay and does nothing if one is already recording.
20+
- `startBuffering()` keeps a rolling buffer that is sent on `flush()` or an error, then continues in session mode.
21+
- `stop()` ends the current replay; the next `start()` creates a new replay session.
22+
- `pause()` suspends recording until `resume()` and remains paused across background and foreground transitions and automatic replay restarts in the same process.
23+
- `resume()` continues the same manually paused replay.
24+
- `flush()` sends the current replay data, or starts a full-session replay when recording is stopped.
25+
26+
### Fixes
27+
28+
- Prevents inclusion of `null.` prefix before default-package class names when parsing Java and JNI frames from Android ANR thread dumps ([#5979](https://github.com/getsentry/sentry-java/pull/5979))
29+
- Prevent duplicated breadcrumbs on tombstone-merged native crash events ([#5888](https://github.com/getsentry/sentry-java/pull/5888))
30+
- Prevent a class of Session Replay deadlocks by confining lifecycle state changes to Android's main thread ([#5965](https://github.com/getsentry/sentry-java/pull/5965))
31+
- Symbolicate tombstone native frames for libraries loaded directly from APKs ([#5992](https://github.com/getsentry/sentry-java/pull/5992))
32+
- Prevent a deadlock between the app start extension and the Android performance event processor ([#6007](https://github.com/getsentry/sentry-java/pull/6007))
1733

1834
### Performance
1935

@@ -22,9 +38,9 @@
2238

2339
### Dependencies
2440

25-
- Bump Native SDK from v0.16.2 to v0.16.3 ([#5962](https://github.com/getsentry/sentry-java/pull/5962))
26-
- [changelog](https://github.com/getsentry/sentry-native/blob/master/CHANGELOG.md#0163)
27-
- [diff](https://github.com/getsentry/sentry-native/compare/0.16.2...0.16.3)
41+
- Bump Native SDK from v0.16.2 to v0.16.4 ([#5962](https://github.com/getsentry/sentry-java/pull/5962), [#5996](https://github.com/getsentry/sentry-java/pull/5996))
42+
- [changelog](https://github.com/getsentry/sentry-native/blob/master/CHANGELOG.md#0164)
43+
- [diff](https://github.com/getsentry/sentry-native/compare/0.16.2...0.16.4)
2844

2945
## 8.53.0
3046

gradle.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ android.newDsl=false
1616
android.experimental.lint.version=9.2.1
1717

1818
# Release information
19-
versionName=8.53.0
19+
versionName=8.54.0
2020

2121
# Override the SDK name on native crashes on Android
2222
sentryAndroidSdkName=sentry.native.android

gradle/libs.versions.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -170,7 +170,7 @@ quartz = { module = "org.quartz-scheduler:quartz", version = "2.3.0" }
170170
reactor-core = { module = "io.projectreactor:reactor-core", version = "3.5.3" }
171171
retrofit = { module = "com.squareup.retrofit2:retrofit", version.ref = "retrofit" }
172172
retrofit-gson = { module = "com.squareup.retrofit2:converter-gson", version.ref = "retrofit" }
173-
sentry-native-ndk = { module = "io.sentry:sentry-native-ndk", version = "0.16.3" }
173+
sentry-native-ndk = { module = "io.sentry:sentry-native-ndk", version = "0.16.4" }
174174
servlet-api = { module = "javax.servlet:javax.servlet-api", version = "3.1.0" }
175175
servlet-jakarta-api = { module = "jakarta.servlet:jakarta.servlet-api", version = "6.1.0" }
176176
slf4j-api = { module = "org.slf4j:slf4j-api", version.ref = "slf4j" }

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,7 @@ public final class ActivityLifecycleIntegration
7373
static final long APP_START_TO_UI_LOAD_CONTINUATION_MAX_GAP_NANOS = TimeUnit.MINUTES.toNanos(1);
7474
private static final String TRACE_ORIGIN = "auto.ui.activity";
7575
static final String APP_START_SCREEN_DATA = "app.vitals.start.screen";
76+
static final String APP_START_TYPE_DATA = "app.vitals.start.type";
7677
static final String APP_START_REASON_DATA = "app.vitals.start.reason";
7778
static final String APP_START_TRACE_ORIGIN = "auto.app.start";
7879

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

Lines changed: 22 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,10 @@ public interface ExtendAppStartListener {
3434

3535
private final @NotNull AppStartMetrics metrics;
3636
private final @NotNull AutoClosableReentrantLock lock = new AutoClosableReentrantLock();
37+
// Serializes the two finish paths against each other. Deliberately separate from `lock`:
38+
// finishing re-enters the SDK and that re-entrant path takes `lock`, so the finish cannot run
39+
// under `lock` (see finishTransaction). When both are held the order is finishLock, then `lock`.
40+
private final @NotNull AutoClosableReentrantLock finishLock = new AutoClosableReentrantLock();
3741

3842
private @Nullable ExtendAppStartListener extendAppStartListener;
3943
// We hold onto both the span and its transaction because they mean different things and finish
@@ -108,8 +112,12 @@ public void setData(final @NotNull String key, final @Nullable Object value) {
108112

109113
@Override
110114
public void finishExtendedAppStart() {
111-
try (final @NotNull ISentryLifecycleToken ignored = lock.acquire()) {
112-
final @Nullable ISpan span = extendedSpan;
115+
try (final @NotNull ISentryLifecycleToken ignoredFinish = finishLock.acquire()) {
116+
final @Nullable ISpan span;
117+
try (final @NotNull ISentryLifecycleToken ignored = lock.acquire()) {
118+
span = extendedSpan;
119+
}
120+
// Finishing runs outside `lock`, see the note on finishTransaction.
113121
if (span != null && !span.isFinished()) {
114122
span.finish(SpanStatus.OK);
115123
}
@@ -145,10 +153,19 @@ public boolean isExtended() {
145153
}
146154

147155
public void finishTransaction(final @NotNull SentryDate endTimestamp) {
148-
try (final @NotNull ISentryLifecycleToken ignored = lock.acquire()) {
149-
final @Nullable ITransaction transaction = extendedTransaction;
156+
// Finishing has to run outside `lock`: it captures the transaction synchronously, which runs
157+
// PerformanceAndroidEventProcessor, which calls back into isExtended()/getExtendedEndTime()
158+
// while holding its own lock. Holding `lock` across the call would let the two be taken in
159+
// opposite orders and deadlock. finishLock still serializes this against
160+
// finishExtendedAppStart, so the end-time clamp below and the finish stay atomic.
161+
try (final @NotNull ISentryLifecycleToken ignoredFinish = finishLock.acquire()) {
162+
final @Nullable ITransaction transaction;
163+
final @Nullable ISpan span;
164+
try (final @NotNull ISentryLifecycleToken ignored = lock.acquire()) {
165+
transaction = extendedTransaction;
166+
span = extendedSpan;
167+
}
150168
if (transaction != null && !transaction.isFinished()) {
151-
final @Nullable ISpan span = extendedSpan;
152169
final @Nullable SentryDate spanEnd = span == null ? null : span.getFinishDate();
153170
final @NotNull SentryDate end =
154171
spanEnd != null && spanEnd.isAfter(endTimestamp) ? spanEnd : endTimestamp;

0 commit comments

Comments
 (0)