|
3 | 3 | import io.sentry.clientreport.DiscardReason; |
4 | 4 | import io.sentry.exception.SentryEnvelopeException; |
5 | 5 | import io.sentry.hints.AbnormalExit; |
| 6 | +import io.sentry.hints.ApplyScopeData; |
6 | 7 | import io.sentry.hints.Backfillable; |
| 8 | +import io.sentry.hints.Cached; |
7 | 9 | import io.sentry.hints.DiskFlushNotification; |
8 | 10 | import io.sentry.hints.TransactionEnd; |
9 | 11 | import io.sentry.metrics.EncodedMetrics; |
@@ -198,9 +200,12 @@ private boolean shouldApplyScopeData(final @NotNull CheckIn event, final @NotNul |
198 | 200 | } |
199 | 201 |
|
200 | 202 | final boolean isBackfillable = HintUtils.hasType(hint, Backfillable.class); |
201 | | - // if event is backfillable we don't wanna trigger capture replay, because it's an event from |
202 | | - // the past |
203 | | - if (event != null && !isBackfillable && (event.isErrored() || event.isCrashed())) { |
| 203 | + final boolean isCached = |
| 204 | + HintUtils.hasType(hint, Cached.class) && !HintUtils.hasType(hint, ApplyScopeData.class); |
| 205 | + // if event is backfillable or cached we don't wanna trigger capture replay, because it's |
| 206 | + // an event from the past. If it's cached, but with ApplyScopeData, it comes from the outbox |
| 207 | + // folder and we still want to capture replay (e.g. a native captureException error) |
| 208 | + if (event != null && !isBackfillable && !isCached && (event.isErrored() || event.isCrashed())) { |
204 | 209 | options.getReplayController().captureReplay(event.isCrashed()); |
205 | 210 | } |
206 | 211 |
|
|
0 commit comments