From 9c287f3cf9e8ac7af8189661eb551bf73e8b37c1 Mon Sep 17 00:00:00 2001 From: Peter Velkov Date: Fri, 27 Aug 2021 20:16:30 +0300 Subject: [PATCH 01/31] Package updates add localforage and updated Onyx --- package-lock.json | 227 ++++++++++++++++++++++++++++++++++++++++++++-- package.json | 5 +- 2 files changed, 223 insertions(+), 9 deletions(-) diff --git a/package-lock.json b/package-lock.json index 9ad6ea1ce1c5..544741ccd3f0 100644 --- a/package-lock.json +++ b/package-lock.json @@ -15687,6 +15687,11 @@ "lodash": "^4" } }, + "@xmldom/xmldom": { + "version": "0.7.2", + "resolved": "https://registry.npmjs.org/@xmldom/xmldom/-/xmldom-0.7.2.tgz", + "integrity": "sha512-t/Zqo0ewes3iq6zGqEqJNUWI27Acr3jkmSUNp6E3nl0Z2XbtqAG5XYqPNLdYonILmhcxANsIidh69tHzjXtuRg==" + }, "@xtuc/ieee754": { "version": "1.2.0", "resolved": "https://registry.npmjs.org/@xtuc/ieee754/-/ieee754-1.2.0.tgz", @@ -23181,12 +23186,187 @@ } }, "expo-file-system": { - "version": "11.0.2", - "resolved": "https://registry.npmjs.org/expo-file-system/-/expo-file-system-11.0.2.tgz", - "integrity": "sha512-nodNvUVa+US4N4xnj5BFw8W9ZF/qCHJVC2t45cHWrBiwkVVxz45wjE7uSHUmkMWyWT7a/7AJuL3XJfYp7h90IQ==", + "version": "11.1.3", + "resolved": "https://registry.npmjs.org/expo-file-system/-/expo-file-system-11.1.3.tgz", + "integrity": "sha512-FBRcD6ojrkrZiTZ8O7Fbo833HhZtkhKtLDj4RNZIMpF1i+ZBD2bmeMcfLMeRHNYcBeJno9C4AVXoNQFqDCGQDg==", "requires": { - "@expo/config-plugins": "^1.0.18", + "@expo/config-plugins": "^3.0.0", + "expo-modules-core": "~0.2.0", "uuid": "^3.4.0" + }, + "dependencies": { + "@expo/config-plugins": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/@expo/config-plugins/-/config-plugins-3.1.0.tgz", + "integrity": "sha512-V5qxaxCAExBM0TXmbU1QKiZcAGP3ecu7KXede8vByT15cro5PkcWu2sSdJCYbHQ/gw6Vf/i8sr8gKlN8V8TSLg==", + "requires": { + "@expo/config-types": "^42.0.0", + "@expo/json-file": "8.2.33", + "@expo/plist": "0.0.14", + "chalk": "^4.1.2", + "debug": "^4.3.1", + "find-up": "~5.0.0", + "fs-extra": "9.0.0", + "getenv": "^1.0.0", + "glob": "7.1.6", + "resolve-from": "^5.0.0", + "semver": "^7.3.5", + "slash": "^3.0.0", + "xcode": "^3.0.1", + "xml2js": "^0.4.23" + } + }, + "@expo/config-types": { + "version": "42.0.0", + "resolved": "https://registry.npmjs.org/@expo/config-types/-/config-types-42.0.0.tgz", + "integrity": "sha512-Rj02OMZke2MrGa/1Y/EScmR7VuWbDEHPJyvfFyyLbadUt+Yv6isCdeFzDt71I7gJlPR9T4fzixeYLrtXXOTq0w==" + }, + "@expo/json-file": { + "version": "8.2.33", + "resolved": "https://registry.npmjs.org/@expo/json-file/-/json-file-8.2.33.tgz", + "integrity": "sha512-CDnhjdirUs6OdN5hOSTJ2y3i9EiJMk7Z5iDljC5xyCHCrUex7oyI8vbRsZEojAahxZccgL/PrO+CjakiFFWurg==", + "requires": { + "@babel/code-frame": "~7.10.4", + "json5": "^1.0.1", + "write-file-atomic": "^2.3.0" + } + }, + "@expo/plist": { + "version": "0.0.14", + "resolved": "https://registry.npmjs.org/@expo/plist/-/plist-0.0.14.tgz", + "integrity": "sha512-bb4Ua1M/OdNgS8KiGdSDUjZ/bbPfv3xdPY/lz8Ctp/adlj/QgB8xA7tVPeqSSfJPZqFRwU0qLCnRhpUOnP51VQ==", + "requires": { + "@xmldom/xmldom": "~0.7.0", + "base64-js": "^1.2.3", + "xmlbuilder": "^14.0.0" + } + }, + "chalk": { + "version": "4.1.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", + "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", + "requires": { + "ansi-styles": "^4.1.0", + "supports-color": "^7.1.0" + } + }, + "debug": { + "version": "4.3.2", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.2.tgz", + "integrity": "sha512-mOp8wKcvj7XxC78zLgw/ZA+6TSgkoE2C/ienthhRD298T7UNwAg9diBpLRxC0mOezLl4B0xV7M0cCO6P/O0Xhw==", + "requires": { + "ms": "2.1.2" + } + }, + "find-up": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/find-up/-/find-up-5.0.0.tgz", + "integrity": "sha512-78/PXT1wlLLDgTzDs7sjq9hzz0vXD+zn+7wypEe4fXQxCmdmqfGsEPQxmiCSQI3ajFV91bVSsvNtrJRiW6nGng==", + "requires": { + "locate-path": "^6.0.0", + "path-exists": "^4.0.0" + } + }, + "fs-extra": { + "version": "9.0.0", + "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-9.0.0.tgz", + "integrity": "sha512-pmEYSk3vYsG/bF651KPUXZ+hvjpgWYw/Gc7W9NFUe3ZVLczKKWIij3IKpOrQcdw4TILtibFslZ0UmR8Vvzig4g==", + "requires": { + "at-least-node": "^1.0.0", + "graceful-fs": "^4.2.0", + "jsonfile": "^6.0.1", + "universalify": "^1.0.0" + } + }, + "json5": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/json5/-/json5-1.0.1.tgz", + "integrity": "sha512-aKS4WQjPenRxiQsC93MNfjx+nbF4PAdYzmd/1JIj8HYzqfbu86beTuNgXDzPknWk0n0uARlyewZo4s++ES36Ow==", + "requires": { + "minimist": "^1.2.0" + } + }, + "locate-path": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-6.0.0.tgz", + "integrity": "sha512-iPZK6eYjbxRu3uB4/WZ3EsEIMJFMqAoopl3R+zuq0UjcAm/MO6KCweDgPfP3elTztoKP3KtnVHxTn2NHBSDVUw==", + "requires": { + "p-locate": "^5.0.0" + } + }, + "lru-cache": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-6.0.0.tgz", + "integrity": "sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA==", + "requires": { + "yallist": "^4.0.0" + } + }, + "p-limit": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-3.1.0.tgz", + "integrity": "sha512-TYOanM3wGwNGsZN2cVTYPArw454xnXj5qmWF1bEoAc4+cU/ol7GVh7odevjp1FNHduHc3KZMcFduxU5Xc6uJRQ==", + "requires": { + "yocto-queue": "^0.1.0" + } + }, + "p-locate": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-5.0.0.tgz", + "integrity": "sha512-LaNjtRWUBY++zB5nE/NwcaoMylSPk+S+ZHNB1TzdbMJMny6dynpAGt7X/tl/QYq3TIeE6nxHppbo2LGymrG5Pw==", + "requires": { + "p-limit": "^3.0.2" + } + }, + "resolve-from": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-5.0.0.tgz", + "integrity": "sha512-qYg9KP24dD5qka9J47d0aVky0N+b4fTU89LN9iDnjB5waksiC49rvMB0PrUJQGoTmH50XPiqOvAjDfaijGxYZw==" + }, + "semver": { + "version": "7.3.5", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.3.5.tgz", + "integrity": "sha512-PoeGJYh8HK4BTO/a9Tf6ZG3veo/A7ZVsYrSA6J8ny9nb3B1VrpkuN+z9OE5wfE5p6H4LchYZsegiQgbJD94ZFQ==", + "requires": { + "lru-cache": "^6.0.0" + } + }, + "write-file-atomic": { + "version": "2.4.3", + "resolved": "https://registry.npmjs.org/write-file-atomic/-/write-file-atomic-2.4.3.tgz", + "integrity": "sha512-GaETH5wwsX+GcnzhPgKcKjJ6M2Cq3/iZp1WyY/X1CSqrW+jVNM9Y7D8EC2sM4ZG/V8wZlSniJnCKWPmBYAucRQ==", + "requires": { + "graceful-fs": "^4.1.11", + "imurmurhash": "^0.1.4", + "signal-exit": "^3.0.2" + } + }, + "xcode": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/xcode/-/xcode-3.0.1.tgz", + "integrity": "sha512-kCz5k7J7XbJtjABOvkc5lJmkiDh8VhjVCGNiqdKCscmVpdVUpEAyXv1xmCLkQJ5dsHqx3IPO4XW+NTDhU/fatA==", + "requires": { + "simple-plist": "^1.1.0", + "uuid": "^7.0.3" + }, + "dependencies": { + "uuid": { + "version": "7.0.3", + "resolved": "https://registry.npmjs.org/uuid/-/uuid-7.0.3.tgz", + "integrity": "sha512-DPSke0pXhTZgoF/d+WSt2QaKMCFSfx7QegxEWT+JOuHF5aWrKEn0G+ztjuJg/gG8/ItK+rbPCD/yNv8yyih6Cg==" + } + } + }, + "xmlbuilder": { + "version": "14.0.0", + "resolved": "https://registry.npmjs.org/xmlbuilder/-/xmlbuilder-14.0.0.tgz", + "integrity": "sha512-ts+B2rSe4fIckR6iquDjsKbQFK2NlUk6iG5nf14mDEyldgoc2nEKZ3jZWMPTxGQwVgToSjt6VGIho1H8/fNFTg==" + }, + "yallist": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz", + "integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==" + } } }, "expo-haptics": { @@ -23199,6 +23379,11 @@ "resolved": "https://registry.npmjs.org/expo-image-loader/-/expo-image-loader-2.1.1.tgz", "integrity": "sha512-EeItNIsmw4g+FIb9S9AHE7FAWQkuiIguFMua/RQ2mFHKFZYa/BU32MGagY+e4LzasBVbDKWgd3NHO+EYC6XeEA==" }, + "expo-modules-core": { + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/expo-modules-core/-/expo-modules-core-0.2.0.tgz", + "integrity": "sha512-inpfZ5X/BaTtbj2wG9PA9AC0MN8VyId6KSRlVuEg7+ziurHBy/kKDFxpOddUokhwiln2uhoYPSStJjR/tKypdw==" + }, "expo-permissions": { "version": "12.0.1", "resolved": "https://registry.npmjs.org/expo-permissions/-/expo-permissions-12.0.1.tgz", @@ -25291,6 +25476,11 @@ "resolved": "https://registry.npmjs.org/image-size/-/image-size-0.6.3.tgz", "integrity": "sha512-47xSUiQioGaB96nqtp5/q55m0aBQSQdyIloMOc/x+QVTDZLNmXE892IIDrJ0hM1A5vcNUDD5tDffkSP5lCaIIA==" }, + "immediate": { + "version": "3.0.6", + "resolved": "https://registry.npmjs.org/immediate/-/immediate-3.0.6.tgz", + "integrity": "sha1-nbHb0Pr43m++D13V5Wu2BigN5ps=" + }, "immer": { "version": "8.0.1", "resolved": "https://registry.npmjs.org/immer/-/immer-8.0.1.tgz", @@ -29971,6 +30161,14 @@ "type-check": "~0.4.0" } }, + "lie": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/lie/-/lie-3.1.1.tgz", + "integrity": "sha1-mkNrLMd0bKWd56QfpGmz77dr2H4=", + "requires": { + "immediate": "~3.0.5" + } + }, "lines-and-columns": { "version": "1.1.6", "resolved": "https://registry.npmjs.org/lines-and-columns/-/lines-and-columns-1.1.6.tgz", @@ -30034,6 +30232,14 @@ "json5": "^2.1.2" } }, + "localforage": { + "version": "1.10.0", + "resolved": "https://registry.npmjs.org/localforage/-/localforage-1.10.0.tgz", + "integrity": "sha512-14/H1aX7hzBBmmh7sGPd+AOMkkIrHM3Z1PAyGgZigA1H1p5O5ANnMyWzvpAETtG68/dC4pC0ncy3+PPGzXZHPg==", + "requires": { + "lie": "3.1.1" + } + }, "locate-path": { "version": "5.0.0", "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-5.0.0.tgz", @@ -36098,8 +36304,8 @@ } }, "react-native-onyx": { - "version": "git+https://github.com/Expensify/react-native-onyx.git#6eadd7f73fca87e6551e43607ec78f645e17ef50", - "from": "git+https://github.com/Expensify/react-native-onyx.git#6eadd7f73fca87e6551e43607ec78f645e17ef50", + "version": "git+https://github.com/kidroca/react-native-onyx.git#535cf4898b10cd486fccd2a25725818f03db4799", + "from": "git+https://github.com/kidroca/react-native-onyx.git#535cf4898b10cd486fccd2a25725818f03db4799", "requires": { "ascii-table": "0.0.9", "expensify-common": "git+https://github.com/Expensify/expensify-common.git#2e5cff552cf132da90a3fb9756e6b4fb6ae7b40c", @@ -36507,6 +36713,15 @@ "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz", "integrity": "sha1-p9BVi9icQveV3UIyj3QIMcpTvCU=" }, + "expo-file-system": { + "version": "11.0.2", + "resolved": "https://registry.npmjs.org/expo-file-system/-/expo-file-system-11.0.2.tgz", + "integrity": "sha512-nodNvUVa+US4N4xnj5BFw8W9ZF/qCHJVC2t45cHWrBiwkVVxz45wjE7uSHUmkMWyWT7a/7AJuL3XJfYp7h90IQ==", + "requires": { + "@expo/config-plugins": "^1.0.18", + "uuid": "^3.4.0" + } + }, "find-up": { "version": "5.0.0", "resolved": "https://registry.npmjs.org/find-up/-/find-up-5.0.0.tgz", diff --git a/package.json b/package.json index 345cb9fcc8ad..6677e952d86e 100644 --- a/package.json +++ b/package.json @@ -64,6 +64,7 @@ "expo-haptics": "^10.0.0", "file-loader": "^6.0.0", "html-entities": "^1.3.1", + "localforage": "^1.10.0", "lodash": "4.17.21", "metro-config": "^0.64.0", "moment": "^2.27.0", @@ -84,7 +85,7 @@ "react-native-image-picker": "^4.0.3", "react-native-keyboard-spacer": "^0.4.1", "react-native-modal": "^11.10.0", - "react-native-onyx": "git+https://github.com/Expensify/react-native-onyx.git#6eadd7f73fca87e6551e43607ec78f645e17ef50", + "react-native-onyx": "git+https://github.com/kidroca/react-native-onyx.git#535cf4898b10cd486fccd2a25725818f03db4799", "react-native-pdf": "^6.2.2", "react-native-performance": "^2.0.0", "react-native-permissions": "^3.0.1", @@ -232,7 +233,6 @@ "exclude": [ "expo-face-detector", "expo-constants", - "expo-file-system", "expo-image-loader", "expo-permissions" ] @@ -241,7 +241,6 @@ "exclude": [ "expo-face-detector", "expo-constants", - "expo-file-system", "expo-image-loader", "expo-permissions" ] From ee4f659ed84933e253fd0396e0e6fb604a2bdd3c Mon Sep 17 00:00:00 2001 From: Peter Velkov Date: Fri, 27 Aug 2021 20:17:45 +0300 Subject: [PATCH 02/31] Omit `function` values from the persisted request LocalForage fails to save the value because functions cannot be serialized --- src/libs/Network.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/libs/Network.js b/src/libs/Network.js index a781595089c6..072b8222e9a3 100644 --- a/src/libs/Network.js +++ b/src/libs/Network.js @@ -157,7 +157,10 @@ function processNetworkRequestQueue() { // We filter persisted requests from the normal Queue to remove duplicates networkRequestQueue = _.reject(networkRequestQueue, (request) => { if (!request.data.doNotRetry && request.data.persist) { - retryableRequests.push(request); + // exclude functions as they cannot be persisted + const requestToPersist = _.omit(request, val => _.isFunction(val)); + retryableRequests.push(requestToPersist); + return true; } }); From f37b50283ad4729b7a627e02d7419d721fda0579 Mon Sep 17 00:00:00 2001 From: Peter Velkov Date: Fri, 27 Aug 2021 20:18:54 +0300 Subject: [PATCH 03/31] Persist all `addAction` requests Remove the `!isAttachment` rule as now we can persist Files --- src/libs/actions/Report.js | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/libs/actions/Report.js b/src/libs/actions/Report.js index d9738e883bcf..7ed266017c7d 100644 --- a/src/libs/actions/Report.js +++ b/src/libs/actions/Report.js @@ -1073,10 +1073,8 @@ function addAction(reportID, text, file) { file, clientID: optimisticReportActionID, - // The persist flag enables this request to be retried if we are offline and the app is completely killed. We do - // not retry attachments as we have no solution for storing them persistently and attachments can't be "lost" in - // the same way report actions can. - persist: !isAttachment, + // The persist flag enables this request to be retried if we are offline and the app is completely killed. + persist: true, }) .then((response) => { if (response.jsonCode === 408) { From 5fd5daba70105e7178d28b64e90804b70189f05c Mon Sep 17 00:00:00 2001 From: Peter Velkov Date: Fri, 27 Aug 2021 20:19:46 +0300 Subject: [PATCH 04/31] Add Expo File System to be used for mobile persistence --- .../main/java/com/expensify/chat/generated/BasePackageList.java | 1 + 1 file changed, 1 insertion(+) diff --git a/android/app/src/main/java/com/expensify/chat/generated/BasePackageList.java b/android/app/src/main/java/com/expensify/chat/generated/BasePackageList.java index 77ee44f9be7a..54db5f1c64b5 100644 --- a/android/app/src/main/java/com/expensify/chat/generated/BasePackageList.java +++ b/android/app/src/main/java/com/expensify/chat/generated/BasePackageList.java @@ -7,6 +7,7 @@ public class BasePackageList { public List getPackageList() { return Arrays.asList( + new expo.modules.filesystem.FileSystemPackage(), new expo.modules.haptics.HapticsPackage() ); } From b6779312027b2284716e9baf6fbad14f33809f5d Mon Sep 17 00:00:00 2001 From: Peter Velkov Date: Sat, 28 Aug 2021 16:31:07 +0300 Subject: [PATCH 05/31] Use Onyx.prepareFile in addAction --- src/libs/actions/Report.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/libs/actions/Report.js b/src/libs/actions/Report.js index 7ed266017c7d..f9f8ff70695c 100644 --- a/src/libs/actions/Report.js +++ b/src/libs/actions/Report.js @@ -997,6 +997,7 @@ function addAction(reportID, text, file) { const parser = new ExpensiMark(); const commentText = parser.replace(text); const isAttachment = _.isEmpty(text) && file !== undefined; + const attachment = isAttachment && Onyx.prepareFile(file); // The new sequence number will be one higher than the highest const highestSequenceNumber = reportMaxSequenceNumbers[reportID] || 0; @@ -1070,7 +1071,7 @@ function addAction(reportID, text, file) { API.Report_AddComment({ reportID, reportComment: commentText, - file, + file: attachment || undefined, clientID: optimisticReportActionID, // The persist flag enables this request to be retried if we are offline and the app is completely killed. From 4a484ec906b3afb0b282c8ad8e4d4855c65d5dbe Mon Sep 17 00:00:00 2001 From: Peter Velkov Date: Sat, 28 Aug 2021 17:15:52 +0300 Subject: [PATCH 06/31] Fix: AttachmentPicker Capture size information correctly --- src/components/AttachmentPicker/index.native.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/AttachmentPicker/index.native.js b/src/components/AttachmentPicker/index.native.js index db2efe74e535..d0141d1cbcda 100644 --- a/src/components/AttachmentPicker/index.native.js +++ b/src/components/AttachmentPicker/index.native.js @@ -50,7 +50,7 @@ function getDataForUpload(fileData) { name: fileData.fileName || fileData.name || 'chat_attachment', type: fileData.type, uri: fileData.uri, - size: fileData.size, + size: fileData.size || fileData.fileSize, }; } From 91d8f40c50d4ea3d282768d6c1bb699091fa12b7 Mon Sep 17 00:00:00 2001 From: Peter Velkov Date: Sat, 28 Aug 2021 17:22:57 +0300 Subject: [PATCH 07/31] Update onyx hash, update lock file The lock file was update after expo-file-system was uninstalled --- package-lock.json | 10 +++++----- package.json | 2 +- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/package-lock.json b/package-lock.json index 544741ccd3f0..505215a01d8a 100644 --- a/package-lock.json +++ b/package-lock.json @@ -15688,9 +15688,9 @@ } }, "@xmldom/xmldom": { - "version": "0.7.2", - "resolved": "https://registry.npmjs.org/@xmldom/xmldom/-/xmldom-0.7.2.tgz", - "integrity": "sha512-t/Zqo0ewes3iq6zGqEqJNUWI27Acr3jkmSUNp6E3nl0Z2XbtqAG5XYqPNLdYonILmhcxANsIidh69tHzjXtuRg==" + "version": "0.7.3", + "resolved": "https://registry.npmjs.org/@xmldom/xmldom/-/xmldom-0.7.3.tgz", + "integrity": "sha512-8XmJdPut2XGtfFcsNsqEsvMUmAwk7xLq7m+E/GcsU9b5qyFFIsiX4Fvnb5UoQ4wo12Wlm07YFJERoyWUYdbIpw==" }, "@xtuc/ieee754": { "version": "1.2.0", @@ -36304,8 +36304,8 @@ } }, "react-native-onyx": { - "version": "git+https://github.com/kidroca/react-native-onyx.git#535cf4898b10cd486fccd2a25725818f03db4799", - "from": "git+https://github.com/kidroca/react-native-onyx.git#535cf4898b10cd486fccd2a25725818f03db4799", + "version": "git+https://github.com/kidroca/react-native-onyx.git#dcce126f78d956d762db89baa05629b7ceb718e2", + "from": "git+https://github.com/kidroca/react-native-onyx.git#dcce126f78d956d762db89baa05629b7ceb718e2", "requires": { "ascii-table": "0.0.9", "expensify-common": "git+https://github.com/Expensify/expensify-common.git#2e5cff552cf132da90a3fb9756e6b4fb6ae7b40c", diff --git a/package.json b/package.json index 6677e952d86e..607def4efd80 100644 --- a/package.json +++ b/package.json @@ -85,7 +85,7 @@ "react-native-image-picker": "^4.0.3", "react-native-keyboard-spacer": "^0.4.1", "react-native-modal": "^11.10.0", - "react-native-onyx": "git+https://github.com/kidroca/react-native-onyx.git#535cf4898b10cd486fccd2a25725818f03db4799", + "react-native-onyx": "git+https://github.com/kidroca/react-native-onyx.git#dcce126f78d956d762db89baa05629b7ceb718e2", "react-native-pdf": "^6.2.2", "react-native-performance": "^2.0.0", "react-native-permissions": "^3.0.1", From a2ac108c1e843c9d9c3edeaa8a0d765d0e7f13d9 Mon Sep 17 00:00:00 2001 From: Peter Velkov Date: Mon, 30 Aug 2021 12:04:49 +0300 Subject: [PATCH 08/31] Run pod install and add expo-file-system --- ios/Podfile.lock | 86 +++++++++++++++++++++++++++++------------------- 1 file changed, 53 insertions(+), 33 deletions(-) diff --git a/ios/Podfile.lock b/ios/Podfile.lock index a9758020438c..867a94269227 100644 --- a/ios/Podfile.lock +++ b/ios/Podfile.lock @@ -14,8 +14,20 @@ PODS: - boost-for-react-native (1.63.0) - CocoaAsyncSocket (7.6.5) - DoubleConversion (1.1.6) + - EXFileSystem (11.1.3): + - ExpoModulesCore + - UMCore - EXHaptics (10.0.0): - UMCore + - ExpoModulesCore (0.2.0): + - ExpoModulesCore/Core (= 0.2.0) + - ExpoModulesCore/Interfaces (= 0.2.0) + - UMCore + - ExpoModulesCore/Core (0.2.0): + - UMCore + - ExpoModulesCore/Interfaces (0.2.0): + - ExpoModulesCore/Core + - UMCore - FBLazyVector (0.64.1) - FBReactNativeSpec (0.64.1): - RCT-Folly (= 2020.01.13.00) @@ -416,7 +428,7 @@ PODS: - React-Core - react-native-flipper (0.103.0): - React-Core - - react-native-image-picker (4.0.3): + - react-native-image-picker (4.0.6): - React-Core - react-native-netinfo (5.9.10): - React-Core @@ -592,7 +604,9 @@ PODS: DEPENDENCIES: - DoubleConversion (from `../node_modules/react-native/third-party-podspecs/DoubleConversion.podspec`) + - EXFileSystem (from `../node_modules/expo-file-system/ios`) - EXHaptics (from `../node_modules/expo-haptics/ios`) + - ExpoModulesCore (from `../node_modules/expo-modules-core/ios`) - FBLazyVector (from `../node_modules/react-native/Libraries/FBLazyVector`) - FBReactNativeSpec (from `../node_modules/react-native/React/FBReactNativeSpec`) - Flipper (~> 0.75.1) @@ -728,8 +742,12 @@ SPEC REPOS: EXTERNAL SOURCES: DoubleConversion: :podspec: "../node_modules/react-native/third-party-podspecs/DoubleConversion.podspec" + EXFileSystem: + :path: "../node_modules/expo-file-system/ios" EXHaptics: :path: "../node_modules/expo-haptics/ios" + ExpoModulesCore: + :path: "../node_modules/expo-modules-core/ios" FBLazyVector: :path: "../node_modules/react-native/Libraries/FBLazyVector" FBReactNativeSpec: @@ -880,7 +898,9 @@ SPEC CHECKSUMS: boost-for-react-native: 39c7adb57c4e60d6c5479dd8623128eb5b3f0f2c CocoaAsyncSocket: 065fd1e645c7abab64f7a6a2007a48038fdc6a99 DoubleConversion: cf9b38bf0b2d048436d9a82ad2abe1404f11e7de - EXHaptics: 337c160c148baa6f0e7166249f368965906e346b + EXFileSystem: 94496f1160b0bf7f000fe04e38ecb2aa63083a2c + EXHaptics: 2de40c5f50a9e78da92c209db06db5134d8cac0b + ExpoModulesCore: 730c7158b2fb179ba5921230e56a083a2304974d FBLazyVector: 7b423f9e248eae65987838148c36eec1dbfe0b53 FBReactNativeSpec: d2bbf7ed8374a5ef7e82afdce19c4e50731f1f0e Firebase: 54cdc8bc9c9b3de54f43dab86e62f5a76b47034f @@ -897,7 +917,7 @@ SPEC CHECKSUMS: Flipper-Folly: 755929a4f851b2fb2c347d533a23f191b008554c Flipper-Glog: 1dfd6abf1e922806c52ceb8701a3599a79a200a6 Flipper-PeerTalk: 116d8f857dc6ef55c7a5a75ea3ceaafe878aadc9 - flipper-plugin-react-native-performance: c639bbaf0e0444bab8eeb86dad93651c2e13291e + flipper-plugin-react-native-performance: 82e0d9bf8f330d2e256ff018978e2a19b86fec17 Flipper-RSocket: 127954abe8b162fcaf68d2134d34dc2bd7076154 FlipperKit: 8a20b5c5fcf9436cac58551dc049867247f64b00 glog: 73c2498ac6884b13ede40eda8228cb1eee9d9d62 @@ -910,9 +930,9 @@ SPEC CHECKSUMS: Onfido: 116a268e4cb8b767c15285e8071c2e8304673cdf onfido-react-native-sdk: b8f1b7cbe1adab6479d735275772390161630dcd OpenSSL-Universal: 1aa4f6a6ee7256b83db99ec1ccdaa80d10f9af9b - Permission-LocationAccuracy: e8adff9ede1b23b43b7054a4500113d515fc87a8 - Permission-LocationAlways: 7f7f373d086af7a81b2f4f20d65d29266ca2043b - Permission-LocationWhenInUse: 3ae82a9feb5da4e94e386dba17c7dd3531af9feb + Permission-LocationAccuracy: 76669f87b4c276f5ae803cc0ddd1862a4c0e9dd8 + Permission-LocationAlways: a274bc04bb386068782468dbdaca3859f51634ca + Permission-LocationWhenInUse: 3a2b0dbc167d79e8e920a4377ff9520cdc108407 Plaid: f55c6acdc249245c6778a4045757eb4e839cca61 PromisesObjC: 68159ce6952d93e17b2dfe273b8c40907db5ba58 Protobuf: 7327d4444215b5f18e560a97f879ff5503c4581c @@ -928,16 +948,16 @@ SPEC CHECKSUMS: React-jsiexecutor: 124e8f99992490d0d13e0649d950d3e1aae06fe9 React-jsinspector: 500a59626037be5b3b3d89c5151bc3baa9abf1a9 react-native-config: d8b45133fd13d4f23bd2064b72f6e2c08b2763ed - react-native-document-picker: 0e3602a4064da040321bafad6848d8b0edcb1d55 + react-native-document-picker: f2f73db94328c84e22144e369fb4a3ede47bc1f5 react-native-flipper: 169e8ba429b73ad637ce007337ce4b415e783799 - react-native-image-picker: 4089335b89b625d4e34d53fb249c48a7a791b3ea - react-native-netinfo: 52cf0ee8342548a485e28f4b09e56b477567244d + react-native-image-picker: 7bda3c7297c3ea16f4f504ad6174aa7e548192ef + react-native-netinfo: 30fb89fa913c342be82a887b56e96be6d71201dd react-native-pdf: 4b5a9e4465a6a3b399e91dc4838eb44ddf716d1f - react-native-performance: 8edfa2bbc9a2af4a02f01d342118e413a95145e0 - react-native-plaid-link-sdk: 1a6593e2d3d790e8113c29178d883eb883f8c032 - react-native-progress-bar-android: ce95a69f11ac580799021633071368d08aaf9ad8 - react-native-progress-view: 5816e8a6be812c2b122c6225a2a3db82d9008640 - react-native-safe-area-context: 01158a92c300895d79dee447e980672dc3fb85a6 + react-native-performance: 6bd6cfac80594775fb782405fceaaf206becf53b + react-native-plaid-link-sdk: 59b7376efca9f00e9693321c5cf7c6ab2c567635 + react-native-progress-bar-android: be43138ab7da30d51fc038bafa98e9ed594d0c40 + react-native-progress-view: 21b1e29e70c7559c16c9e0a04c4adc19fce6ede2 + react-native-safe-area-context: 79fea126c6830c85f65947c223a5e3058a666937 React-perflogger: aad6d4b4a267936b3667260d1f649b6f6069a675 React-RCTActionSheet: fc376be462c9c8d6ad82c0905442fd77f82a9d2a React-RCTAnimation: ba0a1c3a2738be224a08092fa7f1b444ab77d309 @@ -951,34 +971,34 @@ SPEC CHECKSUMS: React-runtimeexecutor: ff951a0c241bfaefc4940a3f1f1a229e7cb32fa6 ReactCommon: bedc99ed4dae329c4fcf128d0c31b9115e5365ca rn-fetch-blob: f065bb7ab7fb48dd002629f8bdcb0336602d3cba - RNBootSplash: 3123ba68fe44d8be09a014e89cc8f0f55b68a521 - RNCAsyncStorage: 8324611026e8dc3706f829953aa6e3899f581589 - RNCClipboard: 5e299c6df8e0c98f3d7416b86ae563d3a9f768a3 - RNCMaskedView: 138134c4d8a9421b4f2bf39055a79aa05c2d47b1 + RNBootSplash: 24175aa28fe203b10c48dc34e78d946fd33c77af + RNCAsyncStorage: 56a3355a10b5d660c48c6e37325ac85ebfd09885 + RNCClipboard: 41d8d918092ae8e676f18adada19104fa3e68495 + RNCMaskedView: fc29d354a40316a990e8fb46391f08aea829c3aa RNCPicker: 6780c753e9e674065db90d9c965920516402579d RNFBAnalytics: 8ba84c2d31c64374d054c8621b998f25145ffddc RNFBApp: 64c90ab78b6010ed5c3ade026dfe5ff6442c21fd RNFBCrashlytics: 1de18b8cc36d9bcf86407c4a354399228cc84a61 RNFBPerf: e3a7269f573a4787810a32de51647cdcbe08dfb4 RNGestureHandler: 9b7e605a741412e20e13c512738a31bd1611759b - RNPermissions: eb94f9fdc0a8ecd02fcce0676d56ffb1395d41e1 + RNPermissions: 4c8a37b4dde50f1f152bf8cd08c4a43d2355829e RNReanimated: 833ebd229b31e18a8933ebd0cd744a0f47d88c42 RNScreens: e8e8dd0588b5da0ab57dcca76ab9b2d8987757e0 RNSVG: ce9d996113475209013317e48b05c21ee988d42e - UMAppLoader: aae896b81e3fcaa6528992e2e19ec8db38c2cedd - UMBarCodeScannerInterface: 96a01d81ff0c7febbfefc2d7396db9e7462d8c68 - UMCameraInterface: 8ad433fdadca22703ebeb614d42b814092d38d69 - UMConstantsInterface: 55c79ca258a3ede70480fed85e3843899cd47ea3 - UMCore: 063edcab3a9de0c44301fe77af147aa1a654b40f - UMFaceDetectorInterface: 4db950a25e785796a237bcebb8fff05078c4fb61 - UMFileSystemInterface: 4a92ee36e6c2757833031718f8496690fa931280 - UMFontInterface: 81a951117d03f57aa636fba3992adefd0191f200 - UMImageLoaderInterface: 5cd09b41630dc8aef7619fabc497c01c0f6b715c - UMPermissionsInterface: 4351145563e703c521fe2299e08227bc3584b94a - UMReactNativeAdapter: 7b458ca3d4497b5114e6bb766b223432bad22d8a - UMSensorsInterface: 50439b47826e716a514cbd7384aebe9ab4fde5f4 - UMTaskManagerInterface: 482155764886069beb1bc7fcf6036f12e4ad0751 - urbanairship-react-native: d415a12e67ba93bf3ce914df9a310b66a88a5cc3 + UMAppLoader: fe2708bb0ac5cd70052bc207d06aa3b7e72b9e97 + UMBarCodeScannerInterface: 79f92bea5f7af39b381a4c82298105ceb537408a + UMCameraInterface: 81ff46700da88435f17afedfc88915eaede7e6a6 + UMConstantsInterface: bb94dd46039dcde276ed50225b29e22785e604bf + UMCore: 2f671796d7439604a1cf8ac7bbe5809cd5c50437 + UMFaceDetectorInterface: 791eec55ffca1171992976b7eceb73e69e391c58 + UMFileSystemInterface: f72245e90ce78fa6427180ff0b0904ead13d8161 + UMFontInterface: 5843cff7db85a42ba629aaac53d33091c35524d3 + UMImageLoaderInterface: 9ddffeb644b3f45d4eb0c2f51a2fd95fd5c8d1a4 + UMPermissionsInterface: 40b72935a7d12a3f60dc6b7bb99ce47908380cb1 + UMReactNativeAdapter: 65ada852a648fcb6674acfbfe72ccb095f2f5b75 + UMSensorsInterface: a5e9db661e5d9ae214762033d725989880ae6993 + UMTaskManagerInterface: 203c11259d2699b5b3a4eda4adbc466f5cb5c561 + urbanairship-react-native: a05a913d6f9559141d477ff4d380bcd616b5c59d Yoga: a7de31c64fe738607e7a3803e3f591a4b1df7393 YogaKit: f782866e155069a2cca2517aafea43200b01fd5a From e474acd83c899d0af0007d0f7985b145a3162b96 Mon Sep 17 00:00:00 2001 From: Peter Velkov Date: Mon, 30 Aug 2021 13:12:55 +0300 Subject: [PATCH 09/31] Remove storage event listener and logic Synchronize tab functionality is moved to Onyx --- src/components/OnyxProvider.js | 4 ---- src/libs/listenToStorageEvents/index.js | 21 ------------------- .../listenToStorageEvents/index.native.js | 8 ------- 3 files changed, 33 deletions(-) delete mode 100644 src/libs/listenToStorageEvents/index.js delete mode 100644 src/libs/listenToStorageEvents/index.native.js diff --git a/src/components/OnyxProvider.js b/src/components/OnyxProvider.js index 0c20ce2cdc66..62e8fddc13cf 100644 --- a/src/components/OnyxProvider.js +++ b/src/components/OnyxProvider.js @@ -6,7 +6,6 @@ import createOnyxContext from './createOnyxContext'; import ComposeProviders from './ComposeProviders'; import CONST from '../CONST'; import Log from '../libs/Log'; -import listenToStorageEvents from '../libs/listenToStorageEvents'; import {canCaptureOnyxMetrics} from '../libs/canCaptureMetrics'; // Initialize the store when the app loads for the first time @@ -25,9 +24,6 @@ Onyx.init({ }, [ONYXKEYS.IS_SIDEBAR_LOADED]: false, }, - registerStorageEventListener: (onStorageEvent) => { - listenToStorageEvents(onStorageEvent); - }, }); Onyx.registerLogger(({level, message}) => { if (level === 'alert') { diff --git a/src/libs/listenToStorageEvents/index.js b/src/libs/listenToStorageEvents/index.js deleted file mode 100644 index a51efcf636e5..000000000000 --- a/src/libs/listenToStorageEvents/index.js +++ /dev/null @@ -1,21 +0,0 @@ -/** - * Listens for storage events so that multiple tabs can keep track of what - * other tabs are doing - * - * @param {Function} callback - */ -function listenToStorageEvents(callback) { - window.addEventListener('storage', (e) => { - let newValue; - try { - newValue = JSON.parse(e.newValue); - } catch (err) { - console.debug('Could not parse the newValue of the storage event', err, e); - } - if (newValue !== undefined) { - callback(e.key, newValue); - } - }); -} - -export default listenToStorageEvents; diff --git a/src/libs/listenToStorageEvents/index.native.js b/src/libs/listenToStorageEvents/index.native.js deleted file mode 100644 index c1221db97d64..000000000000 --- a/src/libs/listenToStorageEvents/index.native.js +++ /dev/null @@ -1,8 +0,0 @@ -/** - * Native clients don't have storage events and that's OK because - * you can't have multiple native clients open at the same time on the same - * device - */ -function listenToStorageEvents() {} - -export default listenToStorageEvents; From 3ea51ec12536c2bc148de4814b780ed8e36b2b69 Mon Sep 17 00:00:00 2001 From: Peter Velkov Date: Mon, 30 Aug 2021 15:01:32 +0300 Subject: [PATCH 10/31] Update onyx hash, update lock file --- ios/Podfile.lock | 4 ++-- package-lock.json | 4 ++-- package.json | 3 ++- 3 files changed, 6 insertions(+), 5 deletions(-) diff --git a/ios/Podfile.lock b/ios/Podfile.lock index 867a94269227..904fe4db85a9 100644 --- a/ios/Podfile.lock +++ b/ios/Podfile.lock @@ -428,7 +428,7 @@ PODS: - React-Core - react-native-flipper (0.103.0): - React-Core - - react-native-image-picker (4.0.6): + - react-native-image-picker (4.0.3): - React-Core - react-native-netinfo (5.9.10): - React-Core @@ -950,7 +950,7 @@ SPEC CHECKSUMS: react-native-config: d8b45133fd13d4f23bd2064b72f6e2c08b2763ed react-native-document-picker: f2f73db94328c84e22144e369fb4a3ede47bc1f5 react-native-flipper: 169e8ba429b73ad637ce007337ce4b415e783799 - react-native-image-picker: 7bda3c7297c3ea16f4f504ad6174aa7e548192ef + react-native-image-picker: 4089335b89b625d4e34d53fb249c48a7a791b3ea react-native-netinfo: 30fb89fa913c342be82a887b56e96be6d71201dd react-native-pdf: 4b5a9e4465a6a3b399e91dc4838eb44ddf716d1f react-native-performance: 6bd6cfac80594775fb782405fceaaf206becf53b diff --git a/package-lock.json b/package-lock.json index 505215a01d8a..ba484805e528 100644 --- a/package-lock.json +++ b/package-lock.json @@ -36304,8 +36304,8 @@ } }, "react-native-onyx": { - "version": "git+https://github.com/kidroca/react-native-onyx.git#dcce126f78d956d762db89baa05629b7ceb718e2", - "from": "git+https://github.com/kidroca/react-native-onyx.git#dcce126f78d956d762db89baa05629b7ceb718e2", + "version": "git+https://github.com/kidroca/react-native-onyx.git#b6ad24440fe0b07b314373c1a4cfdf7914febc3f", + "from": "git+https://github.com/kidroca/react-native-onyx.git#b6ad24440fe0b07b314373c1a4cfdf7914febc3f", "requires": { "ascii-table": "0.0.9", "expensify-common": "git+https://github.com/Expensify/expensify-common.git#2e5cff552cf132da90a3fb9756e6b4fb6ae7b40c", diff --git a/package.json b/package.json index 607def4efd80..3c9d5801b91f 100644 --- a/package.json +++ b/package.json @@ -61,6 +61,7 @@ "electron-serve": "^1.0.0", "electron-updater": "^4.3.4", "expensify-common": "git://github.com/Expensify/expensify-common.git#e5a22b54cde72ff3b9b6b085ea4374144e8937b2", + "expo-file-system": "^11.1.3", "expo-haptics": "^10.0.0", "file-loader": "^6.0.0", "html-entities": "^1.3.1", @@ -85,7 +86,7 @@ "react-native-image-picker": "^4.0.3", "react-native-keyboard-spacer": "^0.4.1", "react-native-modal": "^11.10.0", - "react-native-onyx": "git+https://github.com/kidroca/react-native-onyx.git#dcce126f78d956d762db89baa05629b7ceb718e2", + "react-native-onyx": "git+https://github.com/kidroca/react-native-onyx.git#b6ad24440fe0b07b314373c1a4cfdf7914febc3f", "react-native-pdf": "^6.2.2", "react-native-performance": "^2.0.0", "react-native-permissions": "^3.0.1", From 40737181afa12a4c1bf96cec21a62be44ef77250 Mon Sep 17 00:00:00 2001 From: Peter Velkov Date: Mon, 1 Nov 2021 22:53:09 +0200 Subject: [PATCH 11/31] Update Onyx hash with the latest file storage POC --- package.json | 2 +- src/libs/actions/Report.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/package.json b/package.json index c33f9526db07..453fbf0e1652 100644 --- a/package.json +++ b/package.json @@ -88,7 +88,7 @@ "react-native-image-picker": "^4.0.3", "react-native-keyboard-spacer": "^0.4.1", "react-native-modal": "^11.10.0", - "react-native-onyx": "git+https://github.com/kidroca/react-native-onyx.git#b6ad24440fe0b07b314373c1a4cfdf7914febc3f", + "react-native-onyx": "git+https://github.com/kidroca/react-native-onyx.git#029a7a9da448f5b8a582055eda034e187a57d80a", "react-native-pdf": "^6.2.2", "react-native-performance": "^2.0.0", "react-native-permissions": "^3.0.1", diff --git a/src/libs/actions/Report.js b/src/libs/actions/Report.js index a61a3623fefb..2f432e8d00a5 100644 --- a/src/libs/actions/Report.js +++ b/src/libs/actions/Report.js @@ -1002,7 +1002,7 @@ function fetchAllReports( * * @param {Number} reportID * @param {String} text - * @param {Object} [file] + * @param {File} [file] */ function addAction(reportID, text, file) { // Convert the comment from MD into HTML because that's how it is stored in the database From 044278d4959facf4c1f199d874b261bfa8fe212b Mon Sep 17 00:00:00 2001 From: Peter Velkov Date: Tue, 2 Nov 2021 14:59:05 +0200 Subject: [PATCH 12/31] Remove expo-file-system Onyx no longer needs this Removing `prepareFile` usage --- package-lock.json | 223 +--------------------------------------------- package.json | 3 +- 2 files changed, 5 insertions(+), 221 deletions(-) diff --git a/package-lock.json b/package-lock.json index f2c049ac76ab..b8c305859521 100644 --- a/package-lock.json +++ b/package-lock.json @@ -2918,188 +2918,6 @@ } } }, - "@expo/config-plugins": { - "version": "4.0.6", - "resolved": "https://registry.npmjs.org/@expo/config-plugins/-/config-plugins-4.0.6.tgz", - "integrity": "sha512-K/KQaw/CU8uLQgk7sFnZC54YGHoGucKFfdjYeZx5ds2eyzbuMAiKzGFcxZ/S+1dVBZ8QHzwowsVBW3kuYhnQ3Q==", - "requires": { - "@expo/config-types": "^43.0.1", - "@expo/json-file": "8.2.33", - "@expo/plist": "0.0.15", - "@react-native/normalize-color": "^2.0.0", - "chalk": "^4.1.2", - "debug": "^4.3.1", - "find-up": "~5.0.0", - "fs-extra": "9.0.0", - "getenv": "^1.0.0", - "glob": "7.1.6", - "resolve-from": "^5.0.0", - "semver": "^7.3.5", - "slash": "^3.0.0", - "xcode": "^3.0.1", - "xml2js": "0.4.23" - }, - "dependencies": { - "@react-native/normalize-color": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/@react-native/normalize-color/-/normalize-color-2.0.0.tgz", - "integrity": "sha512-Wip/xsc5lw8vsBlmY2MO/gFLp3MvuZ2baBZjDeTjjndMgM0h5sxz7AZR62RDPGgstp8Np7JzjvVqVT7tpFZqsw==" - }, - "chalk": { - "version": "4.1.2", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", - "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", - "requires": { - "ansi-styles": "^4.1.0", - "supports-color": "^7.1.0" - } - }, - "debug": { - "version": "4.3.2", - "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.2.tgz", - "integrity": "sha512-mOp8wKcvj7XxC78zLgw/ZA+6TSgkoE2C/ienthhRD298T7UNwAg9diBpLRxC0mOezLl4B0xV7M0cCO6P/O0Xhw==", - "requires": { - "ms": "2.1.2" - } - }, - "find-up": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/find-up/-/find-up-5.0.0.tgz", - "integrity": "sha512-78/PXT1wlLLDgTzDs7sjq9hzz0vXD+zn+7wypEe4fXQxCmdmqfGsEPQxmiCSQI3ajFV91bVSsvNtrJRiW6nGng==", - "requires": { - "locate-path": "^6.0.0", - "path-exists": "^4.0.0" - } - }, - "fs-extra": { - "version": "9.0.0", - "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-9.0.0.tgz", - "integrity": "sha512-pmEYSk3vYsG/bF651KPUXZ+hvjpgWYw/Gc7W9NFUe3ZVLczKKWIij3IKpOrQcdw4TILtibFslZ0UmR8Vvzig4g==", - "requires": { - "at-least-node": "^1.0.0", - "graceful-fs": "^4.2.0", - "jsonfile": "^6.0.1", - "universalify": "^1.0.0" - } - }, - "locate-path": { - "version": "6.0.0", - "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-6.0.0.tgz", - "integrity": "sha512-iPZK6eYjbxRu3uB4/WZ3EsEIMJFMqAoopl3R+zuq0UjcAm/MO6KCweDgPfP3elTztoKP3KtnVHxTn2NHBSDVUw==", - "requires": { - "p-locate": "^5.0.0" - } - }, - "lru-cache": { - "version": "6.0.0", - "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-6.0.0.tgz", - "integrity": "sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA==", - "requires": { - "yallist": "^4.0.0" - } - }, - "p-limit": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-3.1.0.tgz", - "integrity": "sha512-TYOanM3wGwNGsZN2cVTYPArw454xnXj5qmWF1bEoAc4+cU/ol7GVh7odevjp1FNHduHc3KZMcFduxU5Xc6uJRQ==", - "requires": { - "yocto-queue": "^0.1.0" - } - }, - "p-locate": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-5.0.0.tgz", - "integrity": "sha512-LaNjtRWUBY++zB5nE/NwcaoMylSPk+S+ZHNB1TzdbMJMny6dynpAGt7X/tl/QYq3TIeE6nxHppbo2LGymrG5Pw==", - "requires": { - "p-limit": "^3.0.2" - } - }, - "resolve-from": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-5.0.0.tgz", - "integrity": "sha512-qYg9KP24dD5qka9J47d0aVky0N+b4fTU89LN9iDnjB5waksiC49rvMB0PrUJQGoTmH50XPiqOvAjDfaijGxYZw==" - }, - "semver": { - "version": "7.3.5", - "resolved": "https://registry.npmjs.org/semver/-/semver-7.3.5.tgz", - "integrity": "sha512-PoeGJYh8HK4BTO/a9Tf6ZG3veo/A7ZVsYrSA6J8ny9nb3B1VrpkuN+z9OE5wfE5p6H4LchYZsegiQgbJD94ZFQ==", - "requires": { - "lru-cache": "^6.0.0" - } - }, - "uuid": { - "version": "7.0.3", - "resolved": "https://registry.npmjs.org/uuid/-/uuid-7.0.3.tgz", - "integrity": "sha512-DPSke0pXhTZgoF/d+WSt2QaKMCFSfx7QegxEWT+JOuHF5aWrKEn0G+ztjuJg/gG8/ItK+rbPCD/yNv8yyih6Cg==" - }, - "xcode": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/xcode/-/xcode-3.0.1.tgz", - "integrity": "sha512-kCz5k7J7XbJtjABOvkc5lJmkiDh8VhjVCGNiqdKCscmVpdVUpEAyXv1xmCLkQJ5dsHqx3IPO4XW+NTDhU/fatA==", - "requires": { - "simple-plist": "^1.1.0", - "uuid": "^7.0.3" - } - }, - "yallist": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz", - "integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==" - } - } - }, - "@expo/config-types": { - "version": "43.0.1", - "resolved": "https://registry.npmjs.org/@expo/config-types/-/config-types-43.0.1.tgz", - "integrity": "sha512-EtllpCGDdB/UdwAIs5YXJwBLpbFQNdlLLrxIvoILA9cXrpQMWkeDCT9lQPJzFRMFcLUaMuGvkzX2tR4tx5EQFQ==" - }, - "@expo/json-file": { - "version": "8.2.33", - "resolved": "https://registry.npmjs.org/@expo/json-file/-/json-file-8.2.33.tgz", - "integrity": "sha512-CDnhjdirUs6OdN5hOSTJ2y3i9EiJMk7Z5iDljC5xyCHCrUex7oyI8vbRsZEojAahxZccgL/PrO+CjakiFFWurg==", - "requires": { - "@babel/code-frame": "~7.10.4", - "json5": "^1.0.1", - "write-file-atomic": "^2.3.0" - }, - "dependencies": { - "json5": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/json5/-/json5-1.0.1.tgz", - "integrity": "sha512-aKS4WQjPenRxiQsC93MNfjx+nbF4PAdYzmd/1JIj8HYzqfbu86beTuNgXDzPknWk0n0uARlyewZo4s++ES36Ow==", - "requires": { - "minimist": "^1.2.0" - } - }, - "write-file-atomic": { - "version": "2.4.3", - "resolved": "https://registry.npmjs.org/write-file-atomic/-/write-file-atomic-2.4.3.tgz", - "integrity": "sha512-GaETH5wwsX+GcnzhPgKcKjJ6M2Cq3/iZp1WyY/X1CSqrW+jVNM9Y7D8EC2sM4ZG/V8wZlSniJnCKWPmBYAucRQ==", - "requires": { - "graceful-fs": "^4.1.11", - "imurmurhash": "^0.1.4", - "signal-exit": "^3.0.2" - } - } - } - }, - "@expo/plist": { - "version": "0.0.15", - "resolved": "https://registry.npmjs.org/@expo/plist/-/plist-0.0.15.tgz", - "integrity": "sha512-LDxiS0KNZAGJu4fIJhbEKczmb+zeftl1NU0LE0tj0mozoMI5HSKdMUchgvnBm35bwBl8ekKkAfJJ0ONxljWQjQ==", - "requires": { - "@xmldom/xmldom": "~0.7.0", - "base64-js": "^1.2.3", - "xmlbuilder": "^14.0.0" - }, - "dependencies": { - "xmlbuilder": { - "version": "14.0.0", - "resolved": "https://registry.npmjs.org/xmlbuilder/-/xmlbuilder-14.0.0.tgz", - "integrity": "sha512-ts+B2rSe4fIckR6iquDjsKbQFK2NlUk6iG5nf14mDEyldgoc2nEKZ3jZWMPTxGQwVgToSjt6VGIho1H8/fNFTg==" - } - } - }, "@formatjs/ecma402-abstract": { "version": "1.6.4", "resolved": "https://registry.npmjs.org/@formatjs/ecma402-abstract/-/ecma402-abstract-1.6.4.tgz", @@ -15561,11 +15379,6 @@ "lodash": "^4" } }, - "@xmldom/xmldom": { - "version": "0.7.5", - "resolved": "https://registry.npmjs.org/@xmldom/xmldom/-/xmldom-0.7.5.tgz", - "integrity": "sha512-V3BIhmY36fXZ1OtVcI9W+FxQqxVLsPKcNjWigIaa81dLC9IolJl5Mt4Cvhmr0flUnjSpTdrbMTSbXqYqV5dT6A==" - }, "@xtuc/ieee754": { "version": "1.2.0", "resolved": "https://registry.npmjs.org/@xtuc/ieee754/-/ieee754-1.2.0.tgz", @@ -18801,11 +18614,6 @@ "integrity": "sha1-AWLsLZNR9d3VmpICy6k1NmpyUIA=", "dev": true }, - "compare-versions": { - "version": "3.6.0", - "resolved": "https://registry.npmjs.org/compare-versions/-/compare-versions-3.6.0.tgz", - "integrity": "sha512-W6Af2Iw1z4CB7q4uU4hv646dW9GQuBM+YpC0UvUCWSD8w90SJjp+ujJuXaEMtAXBtSqGfMPuFOVn4/+FlaqfBA==" - }, "component-emitter": { "version": "1.3.0", "resolved": "https://registry.npmjs.org/component-emitter/-/component-emitter-1.3.0.tgz", @@ -23595,25 +23403,6 @@ } } }, - "expo-file-system": { - "version": "13.0.3", - "resolved": "https://registry.npmjs.org/expo-file-system/-/expo-file-system-13.0.3.tgz", - "integrity": "sha512-i65brB1Nd0upWigXMXrN4YSvj5cP77tB4hNCXoWYVaqRKpUnVlEku2FjQ/xVfIWLJMYrFHHC0Kgz/OKsNzQTpg==", - "requires": { - "@expo/config-plugins": "^4.0.2", - "expo-modules-core": "~0.4.4", - "uuid": "^3.4.0" - } - }, - "expo-modules-core": { - "version": "0.4.7", - "resolved": "https://registry.npmjs.org/expo-modules-core/-/expo-modules-core-0.4.7.tgz", - "integrity": "sha512-boEbB3tAYO7WkgcaXToQLY8IUeEGOZeDF+StTL38FA0l8jzJwwQLU7TaWjWEMGfxvvn7KP7V7kFudJKc7dak3g==", - "requires": { - "compare-versions": "^3.4.0", - "invariant": "^2.2.4" - } - }, "express": { "version": "4.17.1", "resolved": "https://registry.npmjs.org/express/-/express-4.17.1.tgz", @@ -24833,11 +24622,6 @@ "resolved": "https://registry.npmjs.org/get-value/-/get-value-2.0.6.tgz", "integrity": "sha1-3BXKHGcjh8p2vTesCjlbogQqLCg=" }, - "getenv": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/getenv/-/getenv-1.0.0.tgz", - "integrity": "sha512-7yetJWqbS9sbn0vIfliPsFgoXMKn/YMF+Wuiog97x+urnSRRRZ7xB+uVkwGKzRgq9CDFfMQnE9ruL5DHv9c6Xg==" - }, "getpass": { "version": "0.1.7", "resolved": "https://registry.npmjs.org/getpass/-/getpass-0.1.7.tgz", @@ -36662,8 +36446,8 @@ } }, "react-native-onyx": { - "version": "git+https://github.com/kidroca/react-native-onyx.git#029a7a9da448f5b8a582055eda034e187a57d80a", - "from": "git+https://github.com/kidroca/react-native-onyx.git#029a7a9da448f5b8a582055eda034e187a57d80a", + "version": "git+https://github.com/kidroca/react-native-onyx.git#fe0646c1b670eb5f6736ec2c2273668e1756bac4", + "from": "git+https://github.com/kidroca/react-native-onyx.git#fe0646c1b670eb5f6736ec2c2273668e1756bac4", "requires": { "ascii-table": "0.0.9", "expensify-common": "git+https://github.com/Expensify/expensify-common.git#2e5cff552cf132da90a3fb9756e6b4fb6ae7b40c", @@ -43380,7 +43164,8 @@ "yocto-queue": { "version": "0.1.0", "resolved": "https://registry.npmjs.org/yocto-queue/-/yocto-queue-0.1.0.tgz", - "integrity": "sha512-rVksvsnNCdJ/ohGc6xgPwyN8eheCxsiLM8mxuE/t/mOVqJewPuO1miLpTHQiRgTKCLexL4MeAFVagts7HmNZ2Q==" + "integrity": "sha512-rVksvsnNCdJ/ohGc6xgPwyN8eheCxsiLM8mxuE/t/mOVqJewPuO1miLpTHQiRgTKCLexL4MeAFVagts7HmNZ2Q==", + "dev": true }, "zwitch": { "version": "1.0.5", diff --git a/package.json b/package.json index 28fd8053bbeb..29322235ee6b 100644 --- a/package.json +++ b/package.json @@ -63,7 +63,6 @@ "electron-serve": "^1.0.0", "electron-updater": "^4.3.4", "expensify-common": "git://github.com/Expensify/expensify-common.git#b5d9167a26cfd40beebdfb79958b3bbed1af7b64", - "expo-file-system": "^13.0.3", "file-loader": "^6.0.0", "html-entities": "^1.3.1", "localforage": "^1.10.0", @@ -89,7 +88,7 @@ "react-native-image-picker": "^4.0.3", "react-native-keyboard-spacer": "^0.4.1", "react-native-modal": "^11.10.0", - "react-native-onyx": "git+https://github.com/kidroca/react-native-onyx.git#029a7a9da448f5b8a582055eda034e187a57d80a", + "react-native-onyx": "git+https://github.com/kidroca/react-native-onyx.git#fe0646c1b670eb5f6736ec2c2273668e1756bac4", "react-native-pdf": "^6.2.2", "react-native-performance": "^2.0.0", "react-native-permissions": "^3.0.1", From 1da8e877883cc2b49c1ba54dcde379d29cd0d2c4 Mon Sep 17 00:00:00 2001 From: Peter Velkov Date: Tue, 2 Nov 2021 16:27:40 +0200 Subject: [PATCH 13/31] Report.js remove Onyx.prepareFile call --- src/libs/actions/Report.js | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/libs/actions/Report.js b/src/libs/actions/Report.js index 178c20b9a8c8..782a5819efed 100644 --- a/src/libs/actions/Report.js +++ b/src/libs/actions/Report.js @@ -1007,7 +1007,6 @@ function addAction(reportID, text, file) { const parser = new ExpensiMark(); const commentText = parser.replace(text); const isAttachment = _.isEmpty(text) && file !== undefined; - const attachment = isAttachment && Onyx.prepareFile(file); // The new sequence number will be one higher than the highest const highestSequenceNumber = reportMaxSequenceNumbers[reportID] || 0; @@ -1080,8 +1079,8 @@ function addAction(reportID, text, file) { API.Report_AddComment({ reportID, + file, reportComment: commentText, - file: attachment || undefined, clientID: optimisticReportActionID, // The persist flag enables this request to be retried if we are offline and the app is completely killed. From 62de1528d30ea6dda99b8209bdd84d6da19a52aa Mon Sep 17 00:00:00 2001 From: Peter Velkov Date: Tue, 2 Nov 2021 17:41:13 +0200 Subject: [PATCH 14/31] AttachmentPicker copy document attachments to cache The document picker makes the attachment available until the application is terminated To persist Document Attachments and be able to use them on the next app launch we need to move them to the cache dir This way we can persist a reference for the attachment in Onyx and support offline files The `ImagePicker` library is doing this by default --- src/components/AttachmentPicker/index.native.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/components/AttachmentPicker/index.native.js b/src/components/AttachmentPicker/index.native.js index 56a4befb6491..216e8a368df9 100644 --- a/src/components/AttachmentPicker/index.native.js +++ b/src/components/AttachmentPicker/index.native.js @@ -52,6 +52,7 @@ function getImagePickerOptions(type) { */ const documentPickerOptions = { type: [RNDocumentPicker.types.allFiles], + copyTo: 'cachesDirectory', }; /** @@ -65,7 +66,7 @@ function getDataForUpload(fileData) { return { name: fileData.fileName || fileData.name || 'chat_attachment', type: fileData.type, - uri: fileData.uri, + uri: fileData.fileCopyUri || fileData.uri, size: fileData.fileSize || fileData.size, }; } From 8d0f6cd9ee418d477e553c0b9c5ab0dfafa15eab Mon Sep 17 00:00:00 2001 From: Peter Velkov Date: Tue, 2 Nov 2021 17:45:55 +0200 Subject: [PATCH 15/31] Bump react-native-flipper version --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 29322235ee6b..3f70e42f0d9e 100644 --- a/package.json +++ b/package.json @@ -163,7 +163,7 @@ "portfinder": "^1.0.28", "pusher-js-mock": "^0.3.3", "react-hot-loader": "^4.12.21", - "react-native-flipper": "^0.103.0", + "react-native-flipper": "^0.117.0", "react-native-performance-flipper-reporter": "^2.0.0", "react-native-svg-transformer": "^0.14.3", "react-test-renderer": "16.13.1", From d33702ca90acd4782ff6da13788e66e6a0597e05 Mon Sep 17 00:00:00 2001 From: Peter Velkov Date: Tue, 2 Nov 2021 17:58:07 +0200 Subject: [PATCH 16/31] Update Pods after package changes --- ios/Podfile.lock | 42 +++++++++++------------------------------- 1 file changed, 11 insertions(+), 31 deletions(-) diff --git a/ios/Podfile.lock b/ios/Podfile.lock index b1c67ad1f178..9825de9add9c 100644 --- a/ios/Podfile.lock +++ b/ios/Podfile.lock @@ -14,18 +14,6 @@ PODS: - boost-for-react-native (1.63.0) - CocoaAsyncSocket (7.6.5) - DoubleConversion (1.1.6) - - EXFileSystem (11.1.3): - - ExpoModulesCore - - UMCore - - ExpoModulesCore (0.2.0): - - ExpoModulesCore/Core (= 0.2.0) - - ExpoModulesCore/Interfaces (= 0.2.0) - - UMCore - - ExpoModulesCore/Core (0.2.0): - - UMCore - - ExpoModulesCore/Interfaces (0.2.0): - - ExpoModulesCore/Core - - UMCore - FBLazyVector (0.64.1) - FBReactNativeSpec (0.64.1): - RCT-Folly (= 2020.01.13.00) @@ -424,7 +412,7 @@ PODS: - React-Core - react-native-document-picker (5.1.0): - React-Core - - react-native-flipper (0.103.0): + - react-native-flipper (0.117.0): - React-Core - react-native-image-picker (4.0.3): - React-Core @@ -542,7 +530,7 @@ PODS: - React-Core - RNReactNativeHapticFeedback (1.13.0): - React-Core - - RNReanimated (2.3.0-alpha.1): + - RNReanimated (2.3.0-beta.3): - DoubleConversion - FBLazyVector - FBReactNativeSpec @@ -584,8 +572,6 @@ PODS: DEPENDENCIES: - DoubleConversion (from `../node_modules/react-native/third-party-podspecs/DoubleConversion.podspec`) - - EXFileSystem (from `../node_modules/expo-file-system/ios`) - - ExpoModulesCore (from `../node_modules/expo-modules-core/ios`) - FBLazyVector (from `../node_modules/react-native/Libraries/FBLazyVector`) - FBReactNativeSpec (from `../node_modules/react-native/React/FBReactNativeSpec`) - Flipper (~> 0.75.1) @@ -710,10 +696,6 @@ SPEC REPOS: EXTERNAL SOURCES: DoubleConversion: :podspec: "../node_modules/react-native/third-party-podspecs/DoubleConversion.podspec" - EXFileSystem: - :path: "../node_modules/expo-file-system/ios" - ExpoModulesCore: - :path: "../node_modules/expo-modules-core/ios" FBLazyVector: :path: "../node_modules/react-native/Libraries/FBLazyVector" FBReactNativeSpec: @@ -842,10 +824,8 @@ SPEC CHECKSUMS: boost-for-react-native: 39c7adb57c4e60d6c5479dd8623128eb5b3f0f2c CocoaAsyncSocket: 065fd1e645c7abab64f7a6a2007a48038fdc6a99 DoubleConversion: cf9b38bf0b2d048436d9a82ad2abe1404f11e7de - EXFileSystem: 94496f1160b0bf7f000fe04e38ecb2aa63083a2c - ExpoModulesCore: 730c7158b2fb179ba5921230e56a083a2304974d FBLazyVector: 7b423f9e248eae65987838148c36eec1dbfe0b53 - FBReactNativeSpec: e6c5eb078317f6a15612c7e3b4d410c4d01bb703 + FBReactNativeSpec: d2bbf7ed8374a5ef7e82afdce19c4e50731f1f0e Firebase: 54cdc8bc9c9b3de54f43dab86e62f5a76b47034f FirebaseABTesting: c3e48ebf5e7e5c674c5a131c68e941d7921d83dc FirebaseAnalytics: 4751d6a49598a2b58da678cc07df696bcd809ab9 @@ -891,16 +871,16 @@ SPEC CHECKSUMS: React-jsiexecutor: 124e8f99992490d0d13e0649d950d3e1aae06fe9 React-jsinspector: 500a59626037be5b3b3d89c5151bc3baa9abf1a9 react-native-config: d8b45133fd13d4f23bd2064b72f6e2c08b2763ed - react-native-document-picker: f2f73db94328c84e22144e369fb4a3ede47bc1f5 - react-native-flipper: 169e8ba429b73ad637ce007337ce4b415e783799 - react-native-image-picker: 474cf2c33c2b6671da53d293a16c97995f0aec15 + react-native-document-picker: 0e3602a4064da040321bafad6848d8b0edcb1d55 + react-native-flipper: cd9eabd8917104c1bbdca2621717cdca3b2addef + react-native-image-picker: 4089335b89b625d4e34d53fb249c48a7a791b3ea react-native-netinfo: 30fb89fa913c342be82a887b56e96be6d71201dd react-native-pdf: 4b5a9e4465a6a3b399e91dc4838eb44ddf716d1f react-native-performance: 6bd6cfac80594775fb782405fceaaf206becf53b - react-native-plaid-link-sdk: 0b2e16d091abfee30ba01cf37734182ad610f917 + react-native-plaid-link-sdk: dcc247a441571b6e0b9029ab00a30f82e4cfa906 react-native-progress-bar-android: be43138ab7da30d51fc038bafa98e9ed594d0c40 react-native-progress-view: 21b1e29e70c7559c16c9e0a04c4adc19fce6ede2 - react-native-safe-area-context: 79fea126c6830c85f65947c223a5e3058a666937 + react-native-safe-area-context: 01158a92c300895d79dee447e980672dc3fb85a6 React-perflogger: aad6d4b4a267936b3667260d1f649b6f6069a675 React-RCTActionSheet: fc376be462c9c8d6ad82c0905442fd77f82a9d2a React-RCTAnimation: ba0a1c3a2738be224a08092fa7f1b444ab77d309 @@ -919,7 +899,7 @@ SPEC CHECKSUMS: RNCClipboard: 41d8d918092ae8e676f18adada19104fa3e68495 RNCMaskedView: fc29d354a40316a990e8fb46391f08aea829c3aa RNCPicker: 6780c753e9e674065db90d9c965920516402579d - RNDateTimePicker: 7658208086d86d09e1627b5c34ba0cf237c60140 + RNDateTimePicker: c9911be59b1f8670b9f244b85af3a7c295e175ed RNFBAnalytics: 8ba84c2d31c64374d054c8621b998f25145ffddc RNFBApp: 64c90ab78b6010ed5c3ade026dfe5ff6442c21fd RNFBCrashlytics: 1de18b8cc36d9bcf86407c4a354399228cc84a61 @@ -927,10 +907,10 @@ SPEC CHECKSUMS: RNGestureHandler: 9b7e605a741412e20e13c512738a31bd1611759b RNPermissions: 4c8a37b4dde50f1f152bf8cd08c4a43d2355829e RNReactNativeHapticFeedback: b83bfb4b537bdd78eb4f6ffe63c6884f7b049ead - RNReanimated: 833ebd229b31e18a8933ebd0cd744a0f47d88c42 + RNReanimated: c1b0bb200ff39d8499340c32559d9760c9b4a181 RNScreens: e8e8dd0588b5da0ab57dcca76ab9b2d8987757e0 RNSVG: ce9d996113475209013317e48b05c21ee988d42e - urbanairship-react-native: ee53526e1f81c5170863dd3e039df7f98730ef53 + urbanairship-react-native: 60b4b4235838ff109a2639b639e2ef01d54ad455 Yoga: a7de31c64fe738607e7a3803e3f591a4b1df7393 YogaKit: f782866e155069a2cca2517aafea43200b01fd5a From 7805eb0864fee5c7dae1c399eb2f3bed96bd3678 Mon Sep 17 00:00:00 2001 From: Peter Velkov Date: Tue, 2 Nov 2021 19:31:53 +0200 Subject: [PATCH 17/31] Update Onyx hash after file handling changes --- package-lock.json | 4 ++-- package.json | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/package-lock.json b/package-lock.json index b8c305859521..c16961442d41 100644 --- a/package-lock.json +++ b/package-lock.json @@ -36446,8 +36446,8 @@ } }, "react-native-onyx": { - "version": "git+https://github.com/kidroca/react-native-onyx.git#fe0646c1b670eb5f6736ec2c2273668e1756bac4", - "from": "git+https://github.com/kidroca/react-native-onyx.git#fe0646c1b670eb5f6736ec2c2273668e1756bac4", + "version": "git+https://github.com/kidroca/react-native-onyx.git#45ddac448fb76ab2ae4d56cebef1d04e84158daa", + "from": "git+https://github.com/kidroca/react-native-onyx.git#45ddac448fb76ab2ae4d56cebef1d04e84158daa", "requires": { "ascii-table": "0.0.9", "expensify-common": "git+https://github.com/Expensify/expensify-common.git#2e5cff552cf132da90a3fb9756e6b4fb6ae7b40c", diff --git a/package.json b/package.json index 3f70e42f0d9e..9bced30ca0aa 100644 --- a/package.json +++ b/package.json @@ -88,7 +88,7 @@ "react-native-image-picker": "^4.0.3", "react-native-keyboard-spacer": "^0.4.1", "react-native-modal": "^11.10.0", - "react-native-onyx": "git+https://github.com/kidroca/react-native-onyx.git#fe0646c1b670eb5f6736ec2c2273668e1756bac4", + "react-native-onyx": "git+https://github.com/kidroca/react-native-onyx.git#45ddac448fb76ab2ae4d56cebef1d04e84158daa", "react-native-pdf": "^6.2.2", "react-native-performance": "^2.0.0", "react-native-permissions": "^3.0.1", From bbfdc5ceabb949d1cd31148b6f77e0f4cfe6b1d8 Mon Sep 17 00:00:00 2001 From: Peter Velkov Date: Tue, 2 Nov 2021 19:35:09 +0200 Subject: [PATCH 18/31] Update image picker and document picker libraries There seems to be some problem and nothing happens when image is selected or when an image is shot --- ios/Podfile.lock | 8 +++--- package-lock.json | 15 ++++++----- package.json | 4 +-- .../AttachmentPicker/index.native.js | 27 +++++++++++-------- 4 files changed, 31 insertions(+), 23 deletions(-) diff --git a/ios/Podfile.lock b/ios/Podfile.lock index 9825de9add9c..070085770c98 100644 --- a/ios/Podfile.lock +++ b/ios/Podfile.lock @@ -410,11 +410,11 @@ PODS: - react-native-config/App (= 1.4.1) - react-native-config/App (1.4.1): - React-Core - - react-native-document-picker (5.1.0): + - react-native-document-picker (7.1.1): - React-Core - react-native-flipper (0.117.0): - React-Core - - react-native-image-picker (4.0.3): + - react-native-image-picker (4.1.2): - React-Core - react-native-netinfo (5.9.10): - React-Core @@ -871,9 +871,9 @@ SPEC CHECKSUMS: React-jsiexecutor: 124e8f99992490d0d13e0649d950d3e1aae06fe9 React-jsinspector: 500a59626037be5b3b3d89c5151bc3baa9abf1a9 react-native-config: d8b45133fd13d4f23bd2064b72f6e2c08b2763ed - react-native-document-picker: 0e3602a4064da040321bafad6848d8b0edcb1d55 + react-native-document-picker: ebcce6982dd91aa6d2b9a38b666895c381015f1d react-native-flipper: cd9eabd8917104c1bbdca2621717cdca3b2addef - react-native-image-picker: 4089335b89b625d4e34d53fb249c48a7a791b3ea + react-native-image-picker: f45729c43d4f854508ab25c0d0f0f711a2a8a267 react-native-netinfo: 30fb89fa913c342be82a887b56e96be6d71201dd react-native-pdf: 4b5a9e4465a6a3b399e91dc4838eb44ddf716d1f react-native-performance: 6bd6cfac80594775fb782405fceaaf206becf53b diff --git a/package-lock.json b/package-lock.json index c16961442d41..1838b6fe0f48 100644 --- a/package-lock.json +++ b/package-lock.json @@ -36353,9 +36353,12 @@ "integrity": "sha512-isK9z1ibzG0Z8HPRhCk0krmvtLknONCpEHLGSpBtf+oQ02PllAXljGMFN/XJCnq3G3MdmP1CffZh3vm4e/A50w==" }, "react-native-document-picker": { - "version": "5.1.0", - "resolved": "https://registry.npmjs.org/react-native-document-picker/-/react-native-document-picker-5.1.0.tgz", - "integrity": "sha512-XMSDibp1GX0UMlVdsmAgjmf4/FJ+TCvVLWdKjV4QkTIO3TbDKsWSAS1+9jgUYcqIwQpO87SFBkvJ5cjOwx9vNA==" + "version": "7.1.1", + "resolved": "https://registry.npmjs.org/react-native-document-picker/-/react-native-document-picker-7.1.1.tgz", + "integrity": "sha512-lEgyfl+JbU/UCDu8UdagBrC5CC71WTfqCzWyGeALLZiXGHrCJo/5BMqWbAc9PSCeiqNMnFkjcybO/kws5gMkxA==", + "requires": { + "invariant": "^2.2.4" + } }, "react-native-flipper": { "version": "0.117.0", @@ -36427,9 +36430,9 @@ "integrity": "sha512-BF66XeP6dzuANsPmmFsJshM2Jyh/Mo1t8FsGc1L9Q9/sVP8MJULDabB1hms+eAoqgtyhMr5BuXV3E1hJ5U5H6Q==" }, "react-native-image-picker": { - "version": "4.0.3", - "resolved": "https://registry.npmjs.org/react-native-image-picker/-/react-native-image-picker-4.0.3.tgz", - "integrity": "sha512-S4a1jE4fAPDzmah/7OVTEAXGz1/wlGyClU+spygmek5rVLERR5BgwnkX3tLP/UvMQbfdPZNUbnH0hEe7su2AZg==" + "version": "4.1.2", + "resolved": "https://registry.npmjs.org/react-native-image-picker/-/react-native-image-picker-4.1.2.tgz", + "integrity": "sha512-e4frAekSJkOgEmL9UOLukGhjtPwHSD7qSf3Rmwk+850ofxKqZFfAIfWc9MO3UmCb6G7oB6PkckyTOGOXybrN5A==" }, "react-native-keyboard-spacer": { "version": "0.4.1", diff --git a/package.json b/package.json index 9bced30ca0aa..a6f0c4bf71f1 100644 --- a/package.json +++ b/package.json @@ -80,12 +80,12 @@ "react-native-bootsplash": "^3.2.0", "react-native-collapsible": "^1.6.0", "react-native-config": "^1.4.0", - "react-native-document-picker": "^5.1.0", + "react-native-document-picker": "^7.1.1", "react-native-gesture-handler": "1.9.0", "react-native-google-places-autocomplete": "^2.4.1", "react-native-haptic-feedback": "^1.13.0", "react-native-image-pan-zoom": "^2.1.12", - "react-native-image-picker": "^4.0.3", + "react-native-image-picker": "^4.1.2", "react-native-keyboard-spacer": "^0.4.1", "react-native-modal": "^11.10.0", "react-native-onyx": "git+https://github.com/kidroca/react-native-onyx.git#45ddac448fb76ab2ae4d56cebef1d04e84158daa", diff --git a/src/components/AttachmentPicker/index.native.js b/src/components/AttachmentPicker/index.native.js index 216e8a368df9..10d07c31f8e5 100644 --- a/src/components/AttachmentPicker/index.native.js +++ b/src/components/AttachmentPicker/index.native.js @@ -118,17 +118,22 @@ class AttachmentPicker extends Component { * Handles the image/document picker result and * sends the selected attachment to the caller (parent component) * - * @param {ImagePickerResponse|DocumentPickerResponse} attachment + * @param {Array} attachments */ - pickAttachment(attachment) { - if (attachment) { - if (attachment.width === -1 || attachment.height === -1) { - this.showImageCorruptionAlert(); - return; - } - const result = getDataForUpload(attachment); - this.completeAttachmentSelection(result); + pickAttachment(attachments = []) { + if (attachments.length === 0) { + return; } + + const fileData = _.first(attachments); + + if (fileData.width === -1 || fileData.height === -1) { + this.showImageCorruptionAlert(); + return; + } + + const result = getDataForUpload(fileData); + this.completeAttachmentSelection(result); } /** @@ -179,7 +184,7 @@ class AttachmentPicker extends Component { } // Resolve with the first (and only) selected file - return resolve(response.assets[0]); + return resolve(response.assets); }); }); } @@ -208,7 +213,7 @@ class AttachmentPicker extends Component { /** * Launch the DocumentPicker. Results are in the same format as ImagePicker * - * @returns {Promise} + * @returns {Promise} */ showDocumentPicker() { return RNDocumentPicker.pick(documentPickerOptions).catch((error) => { From 2a02fb1d27f440737b52b13c0e03b2d81ae6c976 Mon Sep 17 00:00:00 2001 From: Peter Velkov Date: Tue, 2 Nov 2021 20:16:49 +0200 Subject: [PATCH 19/31] Revert reanimated to the previous version This fixes the issue with the image picker not working --- ios/Podfile.lock | 4 ++-- package-lock.json | 24 ++++++++++++------------ package.json | 2 +- 3 files changed, 15 insertions(+), 15 deletions(-) diff --git a/ios/Podfile.lock b/ios/Podfile.lock index 070085770c98..1ba6734dadb9 100644 --- a/ios/Podfile.lock +++ b/ios/Podfile.lock @@ -530,7 +530,7 @@ PODS: - React-Core - RNReactNativeHapticFeedback (1.13.0): - React-Core - - RNReanimated (2.3.0-beta.3): + - RNReanimated (2.3.0-alpha.3): - DoubleConversion - FBLazyVector - FBReactNativeSpec @@ -907,7 +907,7 @@ SPEC CHECKSUMS: RNGestureHandler: 9b7e605a741412e20e13c512738a31bd1611759b RNPermissions: 4c8a37b4dde50f1f152bf8cd08c4a43d2355829e RNReactNativeHapticFeedback: b83bfb4b537bdd78eb4f6ffe63c6884f7b049ead - RNReanimated: c1b0bb200ff39d8499340c32559d9760c9b4a181 + RNReanimated: 8df8a4f5fb1ae48b8378ad4bbc38e47ae0c41e9f RNScreens: e8e8dd0588b5da0ab57dcca76ab9b2d8987757e0 RNSVG: ce9d996113475209013317e48b05c21ee988d42e urbanairship-react-native: 60b4b4235838ff109a2639b639e2ef01d54ad455 diff --git a/package-lock.json b/package-lock.json index 1838b6fe0f48..bdc9e71f25e8 100644 --- a/package-lock.json +++ b/package-lock.json @@ -14734,11 +14734,6 @@ "integrity": "sha512-giAlZwstKbmvMk1OO7WXSj4OZ0keXAcl2TQq4LWHiiPH2ByaH7WeUzng+Qej8UPxxv+8lRTuouo0iaNDBuzIBA==", "dev": true }, - "@types/invariant": { - "version": "2.2.35", - "resolved": "https://registry.npmjs.org/@types/invariant/-/invariant-2.2.35.tgz", - "integrity": "sha512-DxX1V9P8zdJPYQat1gHyY0xj3efl8gnMVjiM9iCY6y27lj+PoQWkgjt8jDqmovPqULkKVpKRg8J36iQiA+EtEg==" - }, "@types/is-function": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/@types/is-function/-/is-function-1.0.1.tgz", @@ -35523,6 +35518,11 @@ "integrity": "sha512-rtGImPZ0YyLrscKI9xTpV8psd6I8VAtjKCzQDlzyDvqJA8XOW78TXYQwNRNd8g8JZnDu8q9Fu/1v4HPAVwVdHA==", "dev": true }, + "react-freeze": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/react-freeze/-/react-freeze-1.0.0.tgz", + "integrity": "sha512-yQaiOqDmoKqks56LN9MTgY06O0qQHgV4FUrikH357DydArSZHQhl0BJFqGKIZoTqi8JizF9Dxhuk1FIZD6qCaw==" + }, "react-helmet-async": { "version": "1.1.2", "resolved": "https://registry.npmjs.org/react-helmet-async/-/react-helmet-async-1.1.2.tgz", @@ -36555,12 +36555,11 @@ } }, "react-native-reanimated": { - "version": "2.3.0-beta.3", - "resolved": "https://registry.npmjs.org/react-native-reanimated/-/react-native-reanimated-2.3.0-beta.3.tgz", - "integrity": "sha512-gIcaBte910Yzre8krVATYsdIq96WFNnKY7dRGSobfcaUttRy+wQu7mvYk502BG3MU1CGh5pI1r31nh3LfdIMhg==", + "version": "2.3.0-alpha.3", + "resolved": "https://registry.npmjs.org/react-native-reanimated/-/react-native-reanimated-2.3.0-alpha.3.tgz", + "integrity": "sha512-Ln+edkTrepKUETKKmGl+GxL8RiB7awBDQFcRJIK39m5ggiLfksOAfqzclpKPLWbAfOvB4cSg+QdowzRN570FXA==", "requires": { "@babel/plugin-transform-object-assign": "^7.10.4", - "@types/invariant": "^2.2.35", "invariant": "^2.2.4", "lodash.isequal": "^4.5.0", "mockdate": "^3.0.2", @@ -36569,10 +36568,11 @@ }, "dependencies": { "react-native-screens": { - "version": "3.8.0", - "resolved": "https://registry.npmjs.org/react-native-screens/-/react-native-screens-3.8.0.tgz", - "integrity": "sha512-lHrnB/elAoMJKv8O12U6BLgeup4lB6ZKJHEOVuG/D72nv/OE9wUusbou6YCB5tp3YbaSpHflPnkFmHA/vCejpw==", + "version": "3.9.0", + "resolved": "https://registry.npmjs.org/react-native-screens/-/react-native-screens-3.9.0.tgz", + "integrity": "sha512-TP/kASLQ/2iGCz4/n9CHeveKC9urzbfYXFH+1TfBnqaBwjIszhVuadiIOQ0qWKdSs6qnBR2xPTp9U18sNoc34A==", "requires": { + "react-freeze": "^1.0.0", "warn-once": "^0.1.0" } } diff --git a/package.json b/package.json index a6f0c4bf71f1..43bd843e992c 100644 --- a/package.json +++ b/package.json @@ -94,7 +94,7 @@ "react-native-permissions": "^3.0.1", "react-native-picker-select": "8.0.4", "react-native-plaid-link-sdk": "^7.1.0", - "react-native-reanimated": "^2.3.0-beta.3", + "react-native-reanimated": "^2.3.0-alpha.1", "react-native-render-html": "6.0.0-beta.8", "react-native-safe-area-context": "^3.1.4", "react-native-screens": "^3.0.0", From 29565c63219600fa1bc5440eb995cbe858bb70b9 Mon Sep 17 00:00:00 2001 From: Peter Velkov Date: Tue, 2 Nov 2021 20:30:54 +0200 Subject: [PATCH 20/31] Run pod install --- ios/Podfile.lock | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ios/Podfile.lock b/ios/Podfile.lock index 1ba6734dadb9..d19f30107bbf 100644 --- a/ios/Podfile.lock +++ b/ios/Podfile.lock @@ -530,7 +530,7 @@ PODS: - React-Core - RNReactNativeHapticFeedback (1.13.0): - React-Core - - RNReanimated (2.3.0-alpha.3): + - RNReanimated (2.3.0-alpha.1): - DoubleConversion - FBLazyVector - FBReactNativeSpec @@ -907,7 +907,7 @@ SPEC CHECKSUMS: RNGestureHandler: 9b7e605a741412e20e13c512738a31bd1611759b RNPermissions: 4c8a37b4dde50f1f152bf8cd08c4a43d2355829e RNReactNativeHapticFeedback: b83bfb4b537bdd78eb4f6ffe63c6884f7b049ead - RNReanimated: 8df8a4f5fb1ae48b8378ad4bbc38e47ae0c41e9f + RNReanimated: 833ebd229b31e18a8933ebd0cd744a0f47d88c42 RNScreens: e8e8dd0588b5da0ab57dcca76ab9b2d8987757e0 RNSVG: ce9d996113475209013317e48b05c21ee988d42e urbanairship-react-native: 60b4b4235838ff109a2639b639e2ef01d54ad455 From f862014a1725ccab80d6d9c2d036ca05915d341a Mon Sep 17 00:00:00 2001 From: Peter Velkov Date: Wed, 3 Nov 2021 23:35:17 +0200 Subject: [PATCH 21/31] Update Onyx hash after file handling changes --- package-lock.json | 4 ++-- package.json | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/package-lock.json b/package-lock.json index bc2ee9da0fd8..a8421f1726ac 100644 --- a/package-lock.json +++ b/package-lock.json @@ -36429,8 +36429,8 @@ } }, "react-native-onyx": { - "version": "git+https://github.com/kidroca/react-native-onyx.git#45ddac448fb76ab2ae4d56cebef1d04e84158daa", - "from": "git+https://github.com/kidroca/react-native-onyx.git#45ddac448fb76ab2ae4d56cebef1d04e84158daa", + "version": "git+https://github.com/kidroca/react-native-onyx.git#5e95175ba9fe8a872328d6db658f69bea9ba008e", + "from": "git+https://github.com/kidroca/react-native-onyx.git#5e95175ba9fe8a872328d6db658f69bea9ba008e", "requires": { "ascii-table": "0.0.9", "expensify-common": "git+https://github.com/Expensify/expensify-common.git#2e5cff552cf132da90a3fb9756e6b4fb6ae7b40c", diff --git a/package.json b/package.json index cd80171da732..107079b8eb78 100644 --- a/package.json +++ b/package.json @@ -87,7 +87,7 @@ "react-native-image-picker": "^4.1.2", "react-native-keyboard-spacer": "^0.4.1", "react-native-modal": "^11.10.0", - "react-native-onyx": "git+https://github.com/kidroca/react-native-onyx.git#45ddac448fb76ab2ae4d56cebef1d04e84158daa", + "react-native-onyx": "git+https://github.com/kidroca/react-native-onyx.git#5e95175ba9fe8a872328d6db658f69bea9ba008e", "react-native-pdf": "^6.2.2", "react-native-performance": "^2.0.0", "react-native-permissions": "^3.0.1", From f5de171d174631554f7821bba95ef00a2fd30912 Mon Sep 17 00:00:00 2001 From: Peter Velkov Date: Wed, 3 Nov 2021 23:35:40 +0200 Subject: [PATCH 22/31] Remove SignoutManager.js - no longer needed --- src/ONYXKEYS.js | 3 --- src/libs/SignoutManager.js | 38 ------------------------------ src/libs/actions/SignInRedirect.js | 5 +--- 3 files changed, 1 insertion(+), 45 deletions(-) delete mode 100644 src/libs/SignoutManager.js diff --git a/src/ONYXKEYS.js b/src/ONYXKEYS.js index ece47440dabe..aa2ef5bce6f7 100755 --- a/src/ONYXKEYS.js +++ b/src/ONYXKEYS.js @@ -132,9 +132,6 @@ export default { // Stores Workspace ID that will be tied to reimbursement account during setup REIMBURSEMENT_ACCOUNT_WORKSPACE_ID: 'reimbursementAccountWorkspaceID', - // Notifies all tabs that they should sign out and clear storage. - SHOULD_SIGN_OUT: 'shouldSignOut', - // Set when we are loading payment methods IS_LOADING_PAYMENT_METHODS: 'isLoadingPaymentMethods', diff --git a/src/libs/SignoutManager.js b/src/libs/SignoutManager.js deleted file mode 100644 index 065d8249cd10..000000000000 --- a/src/libs/SignoutManager.js +++ /dev/null @@ -1,38 +0,0 @@ -import Onyx from 'react-native-onyx'; -import ONYXKEYS from '../ONYXKEYS'; - -let signoutCallback = () => {}; -let errorMessage = ''; -let shouldSignOut = false; -Onyx.connect({ - key: ONYXKEYS.SHOULD_SIGN_OUT, - callback: (val) => { - if (!shouldSignOut && val) { - signoutCallback(errorMessage); - errorMessage = ''; - Onyx.set(ONYXKEYS.SHOULD_SIGN_OUT, false); - } - - shouldSignOut = val; - }, -}); - -/** - * @param {Function} callback - */ -function registerSignoutCallback(callback) { - signoutCallback = callback; -} - -/** - * @param {String} message - */ -function signOut(message) { - errorMessage = message; - Onyx.set(ONYXKEYS.SHOULD_SIGN_OUT, true); -} - -export default { - signOut, - registerSignoutCallback, -}; diff --git a/src/libs/actions/SignInRedirect.js b/src/libs/actions/SignInRedirect.js index 95e8b862d8bc..be838e817111 100644 --- a/src/libs/actions/SignInRedirect.js +++ b/src/libs/actions/SignInRedirect.js @@ -1,5 +1,4 @@ import Onyx from 'react-native-onyx'; -import SignoutManager from '../SignoutManager'; import ONYXKEYS from '../../ONYXKEYS'; let currentActiveClients; @@ -38,8 +37,6 @@ function clearStorageAndRedirect(errorMessage) { }); } -SignoutManager.registerSignoutCallback(clearStorageAndRedirect); - /** * Clears the Onyx store and redirects to the sign in page. * Normally this method would live in Session.js, but that would cause a circular dependency with Network.js. @@ -47,7 +44,7 @@ SignoutManager.registerSignoutCallback(clearStorageAndRedirect); * @param {String} [errorMessage] error message to be displayed on the sign in page */ function redirectToSignIn(errorMessage) { - SignoutManager.signOut(errorMessage); + clearStorageAndRedirect(errorMessage); } export default redirectToSignIn; From 48c80d27b143cd38cde33bf2fc579a8df6e8bc90 Mon Sep 17 00:00:00 2001 From: Peter Velkov Date: Mon, 13 Dec 2021 17:15:16 +0200 Subject: [PATCH 23/31] Revert "Persist all `addAction` requests" This reverts commit f37b50283ad4729b7a627e02d7419d721fda0579. --- src/libs/actions/Report.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/libs/actions/Report.js b/src/libs/actions/Report.js index cc689a33b408..599736ae09f8 100644 --- a/src/libs/actions/Report.js +++ b/src/libs/actions/Report.js @@ -1149,8 +1149,10 @@ function addAction(reportID, text, file) { reportComment: commentText, clientID: optimisticReportActionID, - // The persist flag enables this request to be retried if we are offline and the app is completely killed. - persist: true, + // The persist flag enables this request to be retried if we are offline and the app is completely killed. We do + // not retry attachments as we have no solution for storing them persistently and attachments can't be "lost" in + // the same way report actions can. + persist: !isAttachment, }) .then((response) => { if (response.jsonCode === 408) { From 1db1d72548bf82973a4aa1d403dd296fb474f2d1 Mon Sep 17 00:00:00 2001 From: Peter Velkov Date: Wed, 15 Dec 2021 01:47:28 +0200 Subject: [PATCH 24/31] Update onyx hash (file storage) --- package-lock.json | 4 ++-- package.json | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/package-lock.json b/package-lock.json index 40d22254388c..46ba071d5757 100644 --- a/package-lock.json +++ b/package-lock.json @@ -36818,8 +36818,8 @@ } }, "react-native-onyx": { - "version": "git+https://github.com/kidroca/react-native-onyx.git#5e95175ba9fe8a872328d6db658f69bea9ba008e", - "from": "git+https://github.com/kidroca/react-native-onyx.git#5e95175ba9fe8a872328d6db658f69bea9ba008e", + "version": "git+https://github.com/Expensify/react-native-onyx.git#40c5b14dcc77e1193d027ecc9dd5f2563516e148", + "from": "git+https://github.com/Expensify/react-native-onyx.git#40c5b14dcc77e1193d027ecc9dd5f2563516e148", "requires": { "ascii-table": "0.0.9", "expensify-common": "git+https://github.com/Expensify/expensify-common.git#2e5cff552cf132da90a3fb9756e6b4fb6ae7b40c", diff --git a/package.json b/package.json index 0e9cbf89cd40..98e0a621e01e 100644 --- a/package.json +++ b/package.json @@ -89,7 +89,7 @@ "react-native-image-size": "^1.1.3", "react-native-keyboard-spacer": "^0.4.1", "react-native-modal": "^11.10.0", - "react-native-onyx": "git+https://github.com/kidroca/react-native-onyx.git#5e95175ba9fe8a872328d6db658f69bea9ba008e", + "react-native-onyx": "git+https://github.com/Expensify/react-native-onyx.git#40c5b14dcc77e1193d027ecc9dd5f2563516e148", "react-native-pdf": "^6.2.2", "react-native-performance": "^2.0.0", "react-native-permissions": "^3.0.1", From 2539f474483cddbc10a8944a0e27c11fdabd12ad Mon Sep 17 00:00:00 2001 From: Peter Velkov Date: Tue, 28 Dec 2021 20:08:04 +0200 Subject: [PATCH 25/31] Refactor: remove setShouldSignOut unused leftover --- src/libs/actions/Session/setShouldSignOut.js | 9 --------- 1 file changed, 9 deletions(-) delete mode 100644 src/libs/actions/Session/setShouldSignOut.js diff --git a/src/libs/actions/Session/setShouldSignOut.js b/src/libs/actions/Session/setShouldSignOut.js deleted file mode 100644 index 75acc853e873..000000000000 --- a/src/libs/actions/Session/setShouldSignOut.js +++ /dev/null @@ -1,9 +0,0 @@ -import Onyx from 'react-native-onyx'; -import ONYXKEYS from '../../../ONYXKEYS'; - -/** - * @param {Boolean} shouldSignOut - */ -export default function setShouldSignOut(shouldSignOut) { - Onyx.set(ONYXKEYS.SHOULD_SIGN_OUT, shouldSignOut); -} From 769141b3b5ca46613694f55261164b3b48c1cc66 Mon Sep 17 00:00:00 2001 From: Peter Velkov Date: Tue, 28 Dec 2021 20:49:27 +0200 Subject: [PATCH 26/31] Add MoveToIndexedDB migration --- src/libs/migrateOnyx.js | 2 + src/libs/migrations/MoveToIndexedDB.js | 55 ++++++++++++++++++++++++++ 2 files changed, 57 insertions(+) create mode 100644 src/libs/migrations/MoveToIndexedDB.js diff --git a/src/libs/migrateOnyx.js b/src/libs/migrateOnyx.js index 72629ae833e1..726ad34abe7f 100644 --- a/src/libs/migrateOnyx.js +++ b/src/libs/migrateOnyx.js @@ -3,6 +3,7 @@ import Log from './Log'; import AddEncryptedAuthToken from './migrations/AddEncryptedAuthToken'; import RenameActiveClientsKey from './migrations/RenameActiveClientsKey'; import RenamePriorityModeKey from './migrations/RenamePriorityModeKey'; +import MoveToIndexedDB from './migrations/MoveToIndexedDB'; export default function () { const startTime = Date.now(); @@ -11,6 +12,7 @@ export default function () { return new Promise((resolve) => { // Add all migrations to an array so they are executed in order const migrationPromises = [ + MoveToIndexedDB, RenameActiveClientsKey, RenamePriorityModeKey, AddEncryptedAuthToken, diff --git a/src/libs/migrations/MoveToIndexedDB.js b/src/libs/migrations/MoveToIndexedDB.js new file mode 100644 index 000000000000..c198c926c1de --- /dev/null +++ b/src/libs/migrations/MoveToIndexedDB.js @@ -0,0 +1,55 @@ +import _ from 'underscore'; +import Onyx from 'react-native-onyx'; + +import Log from '../Log'; +import ONYXKEYS from '../../ONYXKEYS'; +import getPlatform from '../getPlatform'; +import CONST from '../../CONST'; + +function shouldMigrate() { + const isTargetPlatform = _.contains([CONST.PLATFORM.WEB, CONST.PLATFORM.DESKTOP], getPlatform()); + if (!isTargetPlatform) { + Log.info('[Migrate Onyx] Skipped migration MoveToIndexedDB (Not applicable to current platform)'); + return false; + } + + const session = window.localStorage.getItem(ONYXKEYS.SESSION); + if (!session) { + Log.info('[Migrate Onyx] Skipped migration MoveToIndexedDB (Not applicable to logged out users)'); + return false; + } + + return true; +} + +function migrate() { + const multiSetData = {}; + + for (let i = 0; i < window.localStorage.length; i += 1) { + const key = window.localStorage.key(i); + const rawValue = window.localStorage.getItem(key); + multiSetData[key] = rawValue && JSON.parse(rawValue); + } + + return Onyx.multiSet(multiSetData) + .then(() => window.localStorage.clear()) + .then(() => Log.info('[Migrate Onyx] Ran migration MoveToIndexedDB')) + .catch((e) => { + Log.alert('[Migrate Onyx] MoveToIndexedDB failed', {error: e.message, stack: e.stack}, false); + return Promise.reject(e); + }); +} + +/** + * This migration is only applicable for desktop/web + * The migration moves user data from local storage to IndexedDb + * + * @returns {Promise} + */ +export default function () { + if (!shouldMigrate()) { + return Promise.resolve(); + } + + return migrate(); +} From 856dd1eee7809639c78c5605c221b9d23d524800 Mon Sep 17 00:00:00 2001 From: Peter Velkov Date: Tue, 28 Dec 2021 21:52:50 +0200 Subject: [PATCH 27/31] Add MoveToIndexedDB tests --- src/libs/migrations/MoveToIndexedDB.js | 2 +- tests/unit/MigrationTest.js | 64 ++++++++++++++++++++++++++ 2 files changed, 65 insertions(+), 1 deletion(-) create mode 100644 tests/unit/MigrationTest.js diff --git a/src/libs/migrations/MoveToIndexedDB.js b/src/libs/migrations/MoveToIndexedDB.js index c198c926c1de..0587b317672e 100644 --- a/src/libs/migrations/MoveToIndexedDB.js +++ b/src/libs/migrations/MoveToIndexedDB.js @@ -14,7 +14,7 @@ function shouldMigrate() { } const session = window.localStorage.getItem(ONYXKEYS.SESSION); - if (!session) { + if (!session || !session.includes('authToken')) { Log.info('[Migrate Onyx] Skipped migration MoveToIndexedDB (Not applicable to logged out users)'); return false; } diff --git a/tests/unit/MigrationTest.js b/tests/unit/MigrationTest.js new file mode 100644 index 000000000000..47a7ee43e0cc --- /dev/null +++ b/tests/unit/MigrationTest.js @@ -0,0 +1,64 @@ +import Onyx from 'react-native-onyx'; +import _ from 'underscore'; +import CONST from '../../src/CONST'; +import getPlatform from '../../src/libs/getPlatform'; +import MoveToIndexedDB from '../../src/libs/migrations/MoveToIndexedDB'; +import ONYXKEYS from '../../src/ONYXKEYS'; + +jest.mock('../../src/libs/getPlatform'); + +// Using fake timers is causing problems with promises getting timed out +// This seems related: https://github.com/facebook/jest/issues/11876 +jest.useRealTimers(); + +describe('MoveToIndexedDb', () => { + beforeEach(() => { + jest.resetAllMocks(); + getPlatform.mockImplementation(() => CONST.PLATFORM.WEB); + }); + + it('Should do nothing for non web/desktop platforms', () => { + // Given the migration is not running on web or desktop + getPlatform.mockImplementation(() => CONST.PLATFORM.ANDROID); + const multiSetSpy = jest.spyOn(Onyx, 'multiSet').mockRejectedValue(new Error('Unexpected Onyx call')); + + // When the migration runs + return MoveToIndexedDB() + .then(() => { + // Then we don't expect any storage calls + expect(multiSetSpy).not.toHaveBeenCalled(); + }); + }); + + it('Should do nothing when there is no old session data', () => { + // Given no session in old storage medium (localStorage) + const multiSetSpy = jest.spyOn(Onyx, 'multiSet').mockRejectedValue(new Error('Unexpected Onyx call')); + + // When the migration runs + return MoveToIndexedDB() + .then(() => { + // Then we don't expect any storage calls + expect(multiSetSpy).not.toHaveBeenCalled(); + }); + }); + + it('Should migrate all keys in localStorage to Onyx', () => { + // Given some old data exists in storage + const data = { + [ONYXKEYS.SESSION]: {authToken: 'mock-token', loading: false}, + [ONYXKEYS.ACCOUNT]: {email: 'test@mock.com'}, + [ONYXKEYS.NETWORK]: {isOffline: true}, + }; + + _.forEach(data, (value, key) => localStorage.setItem(key, JSON.stringify(value))); + + const multiSetSpy = jest.spyOn(Onyx, 'multiSet').mockImplementation(() => Promise.resolve()); + + // When the migration runs + return MoveToIndexedDB() + .then(() => { + // Then multiset should be called with all the data available in localStorage + expect(multiSetSpy).toHaveBeenCalledWith(data); + }); + }); +}); From bd00a831cf157b95b3e95b715668b99eaa6173fa Mon Sep 17 00:00:00 2001 From: Peter Velkov Date: Tue, 28 Dec 2021 22:22:01 +0200 Subject: [PATCH 28/31] MigrateToIndexedDB: Don't remove non Onyx keys from localStorage There are some keys in localStorage that aren't added by Onyx We should not delete or move them to Onyx --- src/libs/migrations/MoveToIndexedDB.js | 13 ++++++++---- tests/unit/MigrationTest.js | 28 ++++++++++++++++++-------- 2 files changed, 29 insertions(+), 12 deletions(-) diff --git a/src/libs/migrations/MoveToIndexedDB.js b/src/libs/migrations/MoveToIndexedDB.js index 0587b317672e..c059a6dd1eb4 100644 --- a/src/libs/migrations/MoveToIndexedDB.js +++ b/src/libs/migrations/MoveToIndexedDB.js @@ -24,16 +24,21 @@ function shouldMigrate() { function migrate() { const multiSetData = {}; + const possibleKeys = _.union(_.values(ONYXKEYS), _.values(ONYXKEYS.COLLECTION)); for (let i = 0; i < window.localStorage.length; i += 1) { const key = window.localStorage.key(i); - const rawValue = window.localStorage.getItem(key); - multiSetData[key] = rawValue && JSON.parse(rawValue); + if (_.some(possibleKeys, entry => key.startsWith(entry))) { + const rawValue = window.localStorage.getItem(key); + multiSetData[key] = rawValue && JSON.parse(rawValue); + } } return Onyx.multiSet(multiSetData) - .then(() => window.localStorage.clear()) - .then(() => Log.info('[Migrate Onyx] Ran migration MoveToIndexedDB')) + .then(() => { + _.each(multiSetData, (value, key) => window.localStorage.removeItem(key)); + Log.info('[Migrate Onyx] Ran migration MoveToIndexedDB'); + }) .catch((e) => { Log.alert('[Migrate Onyx] MoveToIndexedDB failed', {error: e.message, stack: e.stack}, false); return Promise.reject(e); diff --git a/tests/unit/MigrationTest.js b/tests/unit/MigrationTest.js index 47a7ee43e0cc..5e5f17c6a7a3 100644 --- a/tests/unit/MigrationTest.js +++ b/tests/unit/MigrationTest.js @@ -15,34 +15,35 @@ describe('MoveToIndexedDb', () => { beforeEach(() => { jest.resetAllMocks(); getPlatform.mockImplementation(() => CONST.PLATFORM.WEB); + jest.spyOn(Onyx, 'multiSet').mockImplementation(() => Promise.resolve()); + localStorage.clear(); }); it('Should do nothing for non web/desktop platforms', () => { // Given the migration is not running on web or desktop getPlatform.mockImplementation(() => CONST.PLATFORM.ANDROID); - const multiSetSpy = jest.spyOn(Onyx, 'multiSet').mockRejectedValue(new Error('Unexpected Onyx call')); // When the migration runs return MoveToIndexedDB() .then(() => { // Then we don't expect any storage calls - expect(multiSetSpy).not.toHaveBeenCalled(); + expect(Onyx.multiSet).not.toHaveBeenCalled(); }); }); it('Should do nothing when there is no old session data', () => { // Given no session in old storage medium (localStorage) - const multiSetSpy = jest.spyOn(Onyx, 'multiSet').mockRejectedValue(new Error('Unexpected Onyx call')); + localStorage.removeItem(ONYXKEYS.SESSION); // When the migration runs return MoveToIndexedDB() .then(() => { // Then we don't expect any storage calls - expect(multiSetSpy).not.toHaveBeenCalled(); + expect(Onyx.multiSet).not.toHaveBeenCalled(); }); }); - it('Should migrate all keys in localStorage to Onyx', () => { + it('Should migrate Onyx keys in localStorage to (new) Onyx', () => { // Given some old data exists in storage const data = { [ONYXKEYS.SESSION]: {authToken: 'mock-token', loading: false}, @@ -52,13 +53,24 @@ describe('MoveToIndexedDb', () => { _.forEach(data, (value, key) => localStorage.setItem(key, JSON.stringify(value))); - const multiSetSpy = jest.spyOn(Onyx, 'multiSet').mockImplementation(() => Promise.resolve()); - // When the migration runs return MoveToIndexedDB() .then(() => { // Then multiset should be called with all the data available in localStorage - expect(multiSetSpy).toHaveBeenCalledWith(data); + expect(Onyx.multiSet).toHaveBeenCalledWith(data); + }); + }); + + it('Should not clear non Onyx keys from localStorage', () => { + // Given some Onyx and non-Onyx data exists in localStorage + localStorage.setItem(ONYXKEYS.SESSION, JSON.stringify({authToken: 'mock-token', loading: false})); + localStorage.setItem('non-onyx-item', 'MOCK'); + + // When the migration runs + return MoveToIndexedDB() + .then(() => { + // Then non-Onyx data should remain in localStorage + expect(localStorage.getItem('non-onyx-item')).toEqual('MOCK'); }); }); }); From 1e548cb5fc66d8cffe258b0d3d3b4e8f434ff69e Mon Sep 17 00:00:00 2001 From: Peter Velkov Date: Tue, 28 Dec 2021 23:41:04 +0200 Subject: [PATCH 29/31] Package - add `inquirer` back Removed by accident during merge --- package-lock.json | 94 +++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 94 insertions(+) diff --git a/package-lock.json b/package-lock.json index 1dd52f6b03df..79edb97372c7 100644 --- a/package-lock.json +++ b/package-lock.json @@ -25880,6 +25880,100 @@ "integrity": "sha512-7NXolsK4CAS5+xvdj5OMMbI962hU/wvwoxk+LWR9Ek9bVtyuuYScDN6eS0rUm6TxApFpw7CX1o4uJzcd4AyD3Q==", "dev": true }, + "inquirer": { + "version": "3.3.0", + "resolved": "https://registry.npmjs.org/inquirer/-/inquirer-3.3.0.tgz", + "integrity": "sha512-h+xtnyk4EwKvFWHrUYsWErEVR+igKtLdchu+o0Z1RL7VU/jVMFbYir2bp6bAj8efFNxWqHX0dIss6fJQ+/+qeQ==", + "requires": { + "ansi-escapes": "^3.0.0", + "chalk": "^2.0.0", + "cli-cursor": "^2.1.0", + "cli-width": "^2.0.0", + "external-editor": "^2.0.4", + "figures": "^2.0.0", + "lodash": "^4.3.0", + "mute-stream": "0.0.7", + "run-async": "^2.2.0", + "rx-lite": "^4.0.8", + "rx-lite-aggregates": "^4.0.8", + "string-width": "^2.1.0", + "strip-ansi": "^4.0.0", + "through": "^2.3.6" + }, + "dependencies": { + "ansi-regex": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-3.0.0.tgz", + "integrity": "sha1-7QMXwyIGT3lGbAKWa922Bas32Zg=" + }, + "ansi-styles": { + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", + "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", + "requires": { + "color-convert": "^1.9.0" + } + }, + "chalk": { + "version": "2.4.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz", + "integrity": "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==", + "requires": { + "ansi-styles": "^3.2.1", + "escape-string-regexp": "^1.0.5", + "supports-color": "^5.3.0" + } + }, + "color-convert": { + "version": "1.9.3", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz", + "integrity": "sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==", + "requires": { + "color-name": "1.1.3" + } + }, + "color-name": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz", + "integrity": "sha1-p9BVi9icQveV3UIyj3QIMcpTvCU=" + }, + "has-flag": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", + "integrity": "sha1-tdRU3CGZriJWmfNGfloH87lVuv0=" + }, + "is-fullwidth-code-point": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-2.0.0.tgz", + "integrity": "sha1-o7MKXE8ZkYMWeqq5O+764937ZU8=" + }, + "string-width": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-2.1.1.tgz", + "integrity": "sha512-nOqH59deCq9SRHlxq1Aw85Jnt4w6KvLKqWVik6oA9ZklXLNIOlqg4F2yrT1MVaTjAqvVwdfeZ7w7aCvJD7ugkw==", + "requires": { + "is-fullwidth-code-point": "^2.0.0", + "strip-ansi": "^4.0.0" + } + }, + "strip-ansi": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-4.0.0.tgz", + "integrity": "sha1-qEeQIusaw2iocTibY1JixQXuNo8=", + "requires": { + "ansi-regex": "^3.0.0" + } + }, + "supports-color": { + "version": "5.5.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", + "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", + "requires": { + "has-flag": "^3.0.0" + } + } + } + }, "internal-ip": { "version": "4.3.0", "resolved": "https://registry.npmjs.org/internal-ip/-/internal-ip-4.3.0.tgz", From 41004ea0e5f960fced4f47b613baab9eb6db639e Mon Sep 17 00:00:00 2001 From: Peter Velkov Date: Thu, 6 Jan 2022 16:30:31 +0200 Subject: [PATCH 30/31] MoveToIndexedDB - refactor to be more self-explanatory and add docs --- src/libs/migrations/MoveToIndexedDB.js | 60 ++++++++++++++++---------- 1 file changed, 38 insertions(+), 22 deletions(-) diff --git a/src/libs/migrations/MoveToIndexedDB.js b/src/libs/migrations/MoveToIndexedDB.js index c059a6dd1eb4..995be3e09936 100644 --- a/src/libs/migrations/MoveToIndexedDB.js +++ b/src/libs/migrations/MoveToIndexedDB.js @@ -6,6 +6,13 @@ import ONYXKEYS from '../../ONYXKEYS'; import getPlatform from '../getPlatform'; import CONST from '../../CONST'; +/** + * Test whether the current platform is eligible for migration + * This migration is only applicable for desktop/web + * We're also skipping logged-out users as there would be nothing to migrate + * + * @returns {Boolean} + */ function shouldMigrate() { const isTargetPlatform = _.contains([CONST.PLATFORM.WEB, CONST.PLATFORM.DESKTOP], getPlatform()); if (!isTargetPlatform) { @@ -22,32 +29,31 @@ function shouldMigrate() { return true; } -function migrate() { - const multiSetData = {}; - const possibleKeys = _.union(_.values(ONYXKEYS), _.values(ONYXKEYS.COLLECTION)); +/** + * Find Onyx data and move it from local storage to IndexedDB + * + * @returns {Promise} + */ +function applyMigration() { + const onyxKeys = new Set(_.values(ONYXKEYS)); + const onyxCollections = _.values(ONYXKEYS.COLLECTION); - for (let i = 0; i < window.localStorage.length; i += 1) { - const key = window.localStorage.key(i); - if (_.some(possibleKeys, entry => key.startsWith(entry))) { - const rawValue = window.localStorage.getItem(key); - multiSetData[key] = rawValue && JSON.parse(rawValue); - } - } + // Prepare a key-value dictionary of keys eligible for migration + // Targeting existing Onyx keys in local storage or any key prefixed by a collection name + const dataToMigrate = _.chain(window.localStorage) + .keys() + .filter(key => onyxKeys.has(key) || _.some(onyxCollections, collectionKey => key.startsWith(collectionKey))) + .map(key => [key, JSON.parse(window.localStorage.getItem(key))]) + .object() + .value(); - return Onyx.multiSet(multiSetData) - .then(() => { - _.each(multiSetData, (value, key) => window.localStorage.removeItem(key)); - Log.info('[Migrate Onyx] Ran migration MoveToIndexedDB'); - }) - .catch((e) => { - Log.alert('[Migrate Onyx] MoveToIndexedDB failed', {error: e.message, stack: e.stack}, false); - return Promise.reject(e); - }); + // Move the data in Onyx and only then delete it from local storage + return Onyx.multiSet(dataToMigrate) + .then(() => _.each(dataToMigrate, (value, key) => window.localStorage.removeItem(key))); } /** - * This migration is only applicable for desktop/web - * The migration moves user data from local storage to IndexedDb + * Migrate Web/Desktop storage to IndexedDB * * @returns {Promise} */ @@ -56,5 +62,15 @@ export default function () { return Promise.resolve(); } - return migrate(); + return new Promise((resolve, reject) => { + applyMigration() + .then(() => { + Log.info('[Migrate Onyx] Ran migration MoveToIndexedDB'); + resolve(); + }) + .catch((e) => { + Log.alert('[Migrate Onyx] MoveToIndexedDB failed', {error: e.message, stack: e.stack}, false); + reject(e); + }); + }); } From 3266600d5def32e3e2a95fbd3299685257fa679c Mon Sep 17 00:00:00 2001 From: Peter Velkov Date: Thu, 6 Jan 2022 21:03:16 +0200 Subject: [PATCH 31/31] Add flipper 0.117.0 to match the pod speck The Pod file already has this version of Flipper and pipelines are failing due to the mismatch --- package-lock.json | 6 +++--- package.json | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/package-lock.json b/package-lock.json index c10d67c29d21..1eb3f7bd1d58 100644 --- a/package-lock.json +++ b/package-lock.json @@ -38554,9 +38554,9 @@ "integrity": "sha512-cNW4bIJg3nvKaheG8vGMfqCt5LMWX9MS5+wMudgKIHbGO51spRr4sgnlhVgwHLcZ5aeNOVJ8CPRxDIWKRq/0QA==" }, "react-native-flipper": { - "version": "0.103.0", - "resolved": "https://registry.npmjs.org/react-native-flipper/-/react-native-flipper-0.103.0.tgz", - "integrity": "sha512-F49O8FAPLt9BsuKQYre3ATJ8oaghc9xJu/S4WFhKqAboesFoUyB3i8EAkBFbXEgA1+Foolct3QTWQLc7KTI/tA==", + "version": "0.117.0", + "resolved": "https://registry.npmjs.org/react-native-flipper/-/react-native-flipper-0.117.0.tgz", + "integrity": "sha512-r5IdubsO1rdDhRSDIL2Xk3DSZQSwWcNgjxgz7NcD+NuBv8y7mw48LbiW0779/MTHM2K9URshGnfLT0mrI0ZBKA==", "dev": true }, "react-native-gesture-handler": { diff --git a/package.json b/package.json index d61a07867a07..0afd8d735176 100644 --- a/package.json +++ b/package.json @@ -171,7 +171,7 @@ "pusher-js-mock": "^0.3.3", "react-hot-loader": "^4.12.21", "react-native-clean-project": "^4.0.0-alpha4.0", - "react-native-flipper": "^0.103.0", + "react-native-flipper": "^0.117.0", "react-native-performance-flipper-reporter": "^2.0.0", "react-native-svg-transformer": "^0.14.3", "react-test-renderer": "16.13.1",