fix: Crash with AVAssetDownloadTask in setState#7891
Merged
Conversation
Move the isTaskSupported check before the replay network details block that accesses originalRequest. Apple throws NSGenericException when originalRequest is read on AVAssetDownloadTask, which is not a supported task type. Fixes #7886
Contributor
🚨 Detected changes in high risk code 🚨High-risk code can easily blow up and is hard to test. We had severe bugs in the past. Be extra careful when changing these files, and have an extra careful look at these:
|
📲 Install BuildsiOS
|
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #7891 +/- ##
=============================================
+ Coverage 85.489% 85.533% +0.043%
=============================================
Files 487 487
Lines 29647 29647
Branches 12877 12897 +20
=============================================
+ Hits 25345 25358 +13
+ Misses 4250 4238 -12
+ Partials 52 51 -1
... and 8 files with indirect coverage changes Continue to review full report in Codecov by Sentry.
|
Contributor
Performance metrics 🚀
|
| Revision | Plain | With Sentry | Diff |
|---|---|---|---|
| 44b7b59 | 1211.91 ms | 1248.90 ms | 36.99 ms |
| 8693a8f | 1222.37 ms | 1249.31 ms | 26.95 ms |
| 9319185 | 1223.24 ms | 1249.98 ms | 26.73 ms |
| d0b52d1 | 1227.31 ms | 1258.32 ms | 31.01 ms |
| 1c5ecda | 1219.35 ms | 1253.76 ms | 34.41 ms |
| ae8cece | 1216.83 ms | 1251.37 ms | 34.55 ms |
| 92bcc8f | 1233.43 ms | 1270.20 ms | 36.77 ms |
| 9c19a06 | 1217.77 ms | 1248.98 ms | 31.21 ms |
| c5c7a29 | 1223.14 ms | 1258.55 ms | 35.41 ms |
| 71e6611 | 1213.27 ms | 1242.25 ms | 28.98 ms |
App size
| Revision | Plain | With Sentry | Diff |
|---|---|---|---|
| 44b7b59 | 24.14 KiB | 1.15 MiB | 1.13 MiB |
| 8693a8f | 24.14 KiB | 1.16 MiB | 1.13 MiB |
| 9319185 | 24.14 KiB | 1.16 MiB | 1.13 MiB |
| d0b52d1 | 24.14 KiB | 1.15 MiB | 1.13 MiB |
| 1c5ecda | 24.14 KiB | 1.15 MiB | 1.12 MiB |
| ae8cece | 24.14 KiB | 1.15 MiB | 1.13 MiB |
| 92bcc8f | 24.14 KiB | 1.15 MiB | 1.13 MiB |
| 9c19a06 | 24.14 KiB | 1.16 MiB | 1.13 MiB |
| c5c7a29 | 24.14 KiB | 1.15 MiB | 1.13 MiB |
| 71e6611 | 24.14 KiB | 1.15 MiB | 1.12 MiB |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Fixes a regression introduced in 9.12.0 (#7588) where
SentryNetworkTracker.urlSessionTask:setState:accessessessionTask.originalRequestbefore theisTaskSupported:guard.AVAssetDownloadTaskthrowsNSGenericExceptionon that property, causing a 100% crash for any app usingAVAssetDownloadURLSession.The fix moves the
isTaskSupported:check before the#if SENTRY_TARGET_REPLAY_SUPPORTEDblock that accessesoriginalRequest, restoring the guard order from 9.11.0.Fixes #7886
How to test
AVAssetDownloadURLSessionand callmakeAssetDownloadTask(...).resume()NSGenericException: AVAssetDownloadTask does not support originalRequest propertyChecklist