@onekeyfe/react-native-range-downloader 3.0.81-alpha.4 → 3.0.81-alpha.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1634,24 +1634,24 @@ public final class RangeDownloader: NSObject, URLSessionDownloadDelegate {
1634
1634
  if completion.completed {
1635
1635
  return
1636
1636
  }
1637
+ let failure: Error
1638
+ if let recordedError = completion.error {
1639
+ failure = recordedError
1640
+ } else if FirmwareArtifactStore.shared.isTransactionCancelled(
1641
+ descriptor.transactionId
1642
+ ) {
1643
+ failure = FirmwareBackgroundDownloadError.cancelled
1644
+ } else if let taskError = error {
1645
+ failure =
1646
+ isFirmwareArtifactTLSError(taskError)
1647
+ ? FirmwareBackgroundDownloadError.tlsRejected
1648
+ : FirmwareBackgroundDownloadError.transferFailed
1649
+ } else {
1650
+ failure = FirmwareBackgroundDownloadError.transferFailed
1651
+ }
1637
1652
  finishFirmwareTask(
1638
1653
  key: descriptor.key,
1639
- result: .failure(
1640
- completion.error ??
1641
- (
1642
- FirmwareArtifactStore.shared.isTransactionCancelled(
1643
- descriptor.transactionId
1644
- )
1645
- ? FirmwareBackgroundDownloadError.cancelled
1646
- : nil
1647
- ) ??
1648
- error.map {
1649
- isFirmwareArtifactTLSError($0)
1650
- ? FirmwareBackgroundDownloadError.tlsRejected
1651
- : FirmwareBackgroundDownloadError.transferFailed
1652
- } ??
1653
- FirmwareBackgroundDownloadError.transferFailed
1654
- )
1654
+ result: .failure(failure)
1655
1655
  )
1656
1656
  return
1657
1657
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@onekeyfe/react-native-range-downloader",
3
- "version": "3.0.81-alpha.4",
3
+ "version": "3.0.81-alpha.5",
4
4
  "description": "react-native-range-downloader",
5
5
  "main": "./lib/module/index.js",
6
6
  "types": "./lib/typescript/src/index.d.ts",
@@ -88,7 +88,7 @@
88
88
  "typescript": "^5.9.2"
89
89
  },
90
90
  "peerDependencies": {
91
- "@onekeyfe/react-native-sni-connect": "3.0.81-alpha.4",
91
+ "@onekeyfe/react-native-sni-connect": "3.0.81-alpha.5",
92
92
  "react": "*",
93
93
  "react-native": "*",
94
94
  "react-native-nitro-modules": "0.33.2"