1
0
mirror of https://github.com/laurent22/joplin.git synced 2024-12-24 10:27:10 +02:00

Mobile: Fix "Download interrupted" error

This commit is contained in:
Laurent Cozic 2023-05-14 14:31:55 +01:00
parent c639791d4f
commit b023f58497
6 changed files with 25 additions and 46 deletions

View File

@ -290,6 +290,8 @@ PODS:
- glog
- react-native-alarm-notification (2.11.0):
- React
- react-native-blob-util (0.17.3):
- React-Core
- react-native-camera (4.2.1):
- React-Core
- react-native-camera/RCT (= 4.2.1)
@ -398,8 +400,6 @@ PODS:
- React-jsi (= 0.70.6)
- React-logger (= 0.70.6)
- React-perflogger (= 0.70.6)
- rn-fetch-blob (0.12.0):
- React-Core
- RNCClipboard (1.5.1):
- React-Core
- RNCPushNotificationIOS (1.10.1):
@ -472,6 +472,7 @@ DEPENDENCIES:
- React-jsinspector (from `../node_modules/react-native/ReactCommon/jsinspector`)
- React-logger (from `../node_modules/react-native/ReactCommon/logger`)
- "react-native-alarm-notification (from `../node_modules/@joplin/react-native-alarm-notification`)"
- react-native-blob-util (from `../node_modules/react-native-blob-util`)
- react-native-camera (from `../node_modules/react-native-camera`)
- react-native-document-picker (from `../node_modules/react-native-document-picker`)
- react-native-fingerprint-scanner (from `../node_modules/react-native-fingerprint-scanner`)
@ -500,7 +501,6 @@ DEPENDENCIES:
- React-RCTVibration (from `../node_modules/react-native/Libraries/Vibration`)
- React-runtimeexecutor (from `../node_modules/react-native/ReactCommon/runtimeexecutor`)
- ReactCommon/turbomodule/core (from `../node_modules/react-native/ReactCommon`)
- rn-fetch-blob (from `../node_modules/rn-fetch-blob`)
- "RNCClipboard (from `../node_modules/@react-native-community/clipboard`)"
- "RNCPushNotificationIOS (from `../node_modules/@react-native-community/push-notification-ios`)"
- "RNDateTimePicker (from `../node_modules/@react-native-community/datetimepicker`)"
@ -576,6 +576,8 @@ EXTERNAL SOURCES:
:path: "../node_modules/react-native/ReactCommon/logger"
react-native-alarm-notification:
:path: "../node_modules/@joplin/react-native-alarm-notification"
react-native-blob-util:
:path: "../node_modules/react-native-blob-util"
react-native-camera:
:path: "../node_modules/react-native-camera"
react-native-document-picker:
@ -632,8 +634,6 @@ EXTERNAL SOURCES:
:path: "../node_modules/react-native/ReactCommon/runtimeexecutor"
ReactCommon:
:path: "../node_modules/react-native/ReactCommon"
rn-fetch-blob:
:path: "../node_modules/rn-fetch-blob"
RNCClipboard:
:path: "../node_modules/@react-native-community/clipboard"
RNCPushNotificationIOS:
@ -693,6 +693,7 @@ SPEC CHECKSUMS:
React-jsinspector: 60769e5a0a6d4b32294a2456077f59d0266f9a8b
React-logger: 1623c216abaa88974afce404dc8f479406bbc3a0
react-native-alarm-notification: 26527410a6162d07a9dc57f4bbc62e94ff48e65d
react-native-blob-util: 99f4d79189252f597fe0d810c57a3733b1b1dea6
react-native-camera: 3eae183c1d111103963f3dd913b65d01aef8110f
react-native-document-picker: 495c444c0c773c6e83a5d91165890ecb1c0a399a
react-native-fingerprint-scanner: ac6656f18c8e45a7459302b84da41a44ad96dbbe
@ -721,7 +722,6 @@ SPEC CHECKSUMS:
React-RCTVibration: c75ceef7aa60a33b2d5731ebe5800ddde40cefc4
React-runtimeexecutor: 15437b576139df27635400de0599d9844f1ab817
ReactCommon: 349be31adeecffc7986a0de875d7fb0dcf4e251c
rn-fetch-blob: f065bb7ab7fb48dd002629f8bdcb0336602d3cba
RNCClipboard: 41d8d918092ae8e676f18adada19104fa3e68495
RNCPushNotificationIOS: 87b8d16d3ede4532745e05b03c42cff33a36cc45
RNDateTimePicker: 65e1d202799460b286ff5e741d8baf54695e8abd

View File

@ -42,6 +42,7 @@
"react": "18.2.0",
"react-native": "0.70.6",
"react-native-action-button": "2.8.5",
"react-native-blob-util": "0.17.3",
"react-native-camera": "4.2.1",
"react-native-dialogbox": "0.6.10",
"react-native-document-picker": "8.2.0",
@ -70,7 +71,6 @@
"react-native-webview": "11.26.1",
"react-redux": "7.2.9",
"redux": "4.2.1",
"rn-fetch-blob": "0.12.0",
"stream": "0.0.2",
"stream-browserify": "3.0.0",
"string-natural-compare": "3.0.1",

View File

@ -4,7 +4,7 @@
const RNExitApp = require('react-native-exit-app').default;
import { Profile, ProfileConfig } from '@joplin/lib/services/profileConfig/types';
import { loadProfileConfig as libLoadProfileConfig, saveProfileConfig as libSaveProfileConfig } from '@joplin/lib/services/profileConfig/index';
import RNFetchBlob from 'rn-fetch-blob';
import RNFetchBlob from 'react-native-blob-util';
let dispatch_: Function = null;
export const setDispatch = (dispatch: Function) => {

View File

@ -1,5 +1,5 @@
import FsDriverBase, { ReadDirStatsOptions } from '@joplin/lib/fs-driver-base';
const RNFetchBlob = require('rn-fetch-blob').default;
import RNFetchBlob, { Encoding as RNFetchBlobEncoding } from 'react-native-blob-util';
const RNFS = require('react-native-fs');
const DocumentPicker = require('react-native-document-picker').default;
import { openDocument } from '@joplin/react-native-saf-x';
@ -32,7 +32,7 @@ export default class FsDriverRN extends FsDriverBase {
}
// We need to use rn-fetch-blob here due to this bug:
// https://github.com/itinance/react-native-fs/issues/700
return RNFetchBlob.fs.writeFile(path, content, encoding);
return RNFetchBlob.fs.writeFile(path, content, encoding as RNFetchBlobEncoding);
}
// same as rm -rf

View File

@ -1,7 +1,7 @@
const shim = require('@joplin/lib/shim').default;
const { GeolocationReact } = require('./geolocation-react.js');
const PoorManIntervals = require('@joplin/lib/PoorManIntervals').default;
const RNFetchBlob = require('rn-fetch-blob').default;
const RNFetchBlob = require('react-native-blob-util').default;
const { generateSecureRandom } = require('react-native-securerandom');
const FsDriverRN = require('./fs-driver-rn').default;
const { Buffer } = require('buffer');

View File

@ -4957,6 +4957,7 @@ __metadata:
react: 18.2.0
react-native: 0.70.6
react-native-action-button: 2.8.5
react-native-blob-util: 0.17.3
react-native-camera: 4.2.1
react-native-dialogbox: 0.6.10
react-native-document-picker: 8.2.0
@ -4985,7 +4986,6 @@ __metadata:
react-native-webview: 11.26.1
react-redux: 7.2.9
redux: 4.2.1
rn-fetch-blob: 0.12.0
stream: 0.0.2
stream-browserify: 3.0.0
string-natural-compare: 3.0.1
@ -17556,20 +17556,6 @@ __metadata:
languageName: node
linkType: hard
"glob@npm:7.0.6":
version: 7.0.6
resolution: "glob@npm:7.0.6"
dependencies:
fs.realpath: ^1.0.0
inflight: ^1.0.4
inherits: 2
minimatch: ^3.0.2
once: ^1.3.0
path-is-absolute: ^1.0.0
checksum: 6ad065f51982f9a76f7052984121c95bca376ea02060b21200ad62b400422b05f0dc331f72da89a73c21a2451cbe9bec16bb17dcf37a516dc51bbbb6efe462a1
languageName: node
linkType: hard
"glob@npm:8.1.0":
version: 8.1.0
resolution: "glob@npm:8.1.0"
@ -27311,6 +27297,19 @@ __metadata:
languageName: node
linkType: hard
"react-native-blob-util@npm:0.17.3":
version: 0.17.3
resolution: "react-native-blob-util@npm:0.17.3"
dependencies:
base-64: 0.1.0
glob: ^7.2.3
peerDependencies:
react: "*"
react-native: "*"
checksum: 32121a10f6015b97c1a2fd4aa089c68855098b8cfc706c8fa36efb1f8aa601d8275b64ebb3d81877f93d818301891d8cdca2218f09a88b02cf9a374461ed02e2
languageName: node
linkType: hard
"react-native-camera@npm:4.2.1":
version: 4.2.1
resolution: "react-native-camera@npm:4.2.1"
@ -28845,26 +28844,6 @@ __metadata:
languageName: node
linkType: hard
"rn-fetch-blob@npm:0.12.0":
version: 0.12.0
resolution: "rn-fetch-blob@npm:0.12.0"
dependencies:
base-64: 0.1.0
glob: 7.0.6
checksum: 56e5832be583e97d58f955c0c4f6dcb0eb62c97dde331182c6effb726253731cb555d4a5f6c81079ed2fcb957f81633cbe95b37d326d063405f912506de20ff4
languageName: node
linkType: hard
"rn-fetch-blob@patch:rn-fetch-blob@npm%3A0.12.0#./.yarn/patches/rn-fetch-blob-npm-0.12.0-cf02e3c544.patch::locator=root%40workspace%3A.":
version: 0.12.0
resolution: "rn-fetch-blob@patch:rn-fetch-blob@npm%3A0.12.0#./.yarn/patches/rn-fetch-blob-npm-0.12.0-cf02e3c544.patch::version=0.12.0&hash=9431c2&locator=root%40workspace%3A."
dependencies:
base-64: 0.1.0
glob: 7.0.6
checksum: 6535ee347b3e76733a10c3873c14622b35613caa86242536b68f130b75a3379d9bb060ad5c8832d78e639c88869e321c288e5c8e89373cdb0c14f23253c31c50
languageName: node
linkType: hard
"roarr@npm:^2.15.3":
version: 2.15.4
resolution: "roarr@npm:2.15.4"