@onekeyfe/react-native-range-downloader 3.0.81-alpha.6 → 3.0.81-alpha.8
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.
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import CryptoKit
|
|
2
2
|
import Foundation
|
|
3
|
+
import ReactNativeNativeLogger
|
|
3
4
|
import SniConnect
|
|
4
5
|
|
|
5
6
|
func isFirmwareArtifactTLSError(_ error: Error) -> Bool {
|
|
@@ -520,6 +521,10 @@ final class FirmwareArtifactStore {
|
|
|
520
521
|
return artifact
|
|
521
522
|
} catch {
|
|
522
523
|
markDownloadActive(expectedSha256, delta: -1)
|
|
524
|
+
OneKeyLog.error(
|
|
525
|
+
"FirmwareArtifact",
|
|
526
|
+
"event=download_failed transactionId=\(params.transactionId) artifactId=\(params.artifactId) route=\(params.routeType) errorType=\(String(describing: type(of: error)))"
|
|
527
|
+
)
|
|
523
528
|
if error is CancellationError ||
|
|
524
529
|
isTransactionCancelled(params.transactionId) {
|
|
525
530
|
throw FirmwareArtifactStoreError.downloadFailed(
|
|
@@ -581,12 +586,8 @@ final class FirmwareArtifactStore {
|
|
|
581
586
|
return existing
|
|
582
587
|
}
|
|
583
588
|
|
|
584
|
-
|
|
585
|
-
|
|
586
|
-
params: params
|
|
587
|
-
)
|
|
588
|
-
}
|
|
589
|
-
|
|
589
|
+
// Firmware preflight is foreground-bound, so both routes use the same
|
|
590
|
+
// cancellable stream instead of waiting on process-owned background tasks.
|
|
590
591
|
let partialURL = rootURL.appendingPathComponent(
|
|
591
592
|
firmwareArtifactPartialFileName(
|
|
592
593
|
transactionId: params.transactionId,
|
|
@@ -623,11 +624,19 @@ final class FirmwareArtifactStore {
|
|
|
623
624
|
currentSize = 0
|
|
624
625
|
}
|
|
625
626
|
|
|
627
|
+
OneKeyLog.info(
|
|
628
|
+
"FirmwareArtifact",
|
|
629
|
+
"event=stream_start transactionId=\(params.transactionId) artifactId=\(params.artifactId) route=\(params.routeType) expectedBytes=\(Int64(params.expectedSize)) resumeBytes=\(currentSize)"
|
|
630
|
+
)
|
|
626
631
|
try await streamDownload(
|
|
627
632
|
params,
|
|
628
633
|
partialURL: partialURL,
|
|
629
634
|
resumeOffset: min(currentSize, Int64(params.expectedSize))
|
|
630
635
|
)
|
|
636
|
+
OneKeyLog.info(
|
|
637
|
+
"FirmwareArtifact",
|
|
638
|
+
"event=stream_complete transactionId=\(params.transactionId) artifactId=\(params.artifactId) route=\(params.routeType) expectedBytes=\(Int64(params.expectedSize))"
|
|
639
|
+
)
|
|
631
640
|
let artifact: StoredFirmwareArtifact
|
|
632
641
|
do {
|
|
633
642
|
artifact = try validateStoredArtifact(
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@onekeyfe/react-native-range-downloader",
|
|
3
|
-
"version": "3.0.81-alpha.
|
|
3
|
+
"version": "3.0.81-alpha.8",
|
|
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.
|
|
91
|
+
"@onekeyfe/react-native-sni-connect": "3.0.81-alpha.8",
|
|
92
92
|
"react": "*",
|
|
93
93
|
"react-native": "*",
|
|
94
94
|
"react-native-nitro-modules": "0.33.2"
|