|
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.logger.ILoggerBatchProcessor; |
@@ -210,9 +212,12 @@ private boolean shouldApplyScopeData(final @NotNull CheckIn event, final @NotNul |
210 | 212 | } |
211 | 213 |
|
212 | 214 | final boolean isBackfillable = HintUtils.hasType(hint, Backfillable.class); |
213 | | - // if event is backfillable we don't wanna trigger capture replay, because it's an event from |
214 | | - // the past |
215 | | - if (event != null && !isBackfillable && (event.isErrored() || event.isCrashed())) { |
| 215 | + final boolean isCached = |
| 216 | + HintUtils.hasType(hint, Cached.class) && !HintUtils.hasType(hint, ApplyScopeData.class); |
| 217 | + // if event is backfillable or cached we don't wanna trigger capture replay, because it's |
| 218 | + // an event from the past. If it's cached, but with ApplyScopeData, it comes from the outbox |
| 219 | + // folder and we still want to capture replay (e.g. a native captureException error) |
| 220 | + if (event != null && !isBackfillable && !isCached && (event.isErrored() || event.isCrashed())) { |
216 | 221 | options.getReplayController().captureReplay(event.isCrashed()); |
217 | 222 | } |
218 | 223 |
|
|
0 commit comments