diff --git a/README.md b/README.md index 4fee8b6..b495b36 100644 --- a/README.md +++ b/README.md @@ -138,7 +138,7 @@ In the output, you'll find options to open the app in a ### On a device with Expo Go After expo has started, make sure it targets the Expo Go environment (as opposed to "development build"). -This will display a QR code which you will need to scan from your device's Expo Go application. +This will display a QR code which you will need to scan with your device. The Wallet application will then build and install into your device for you to test & debug. diff --git a/components/PopupMenu.tsx b/components/PopupMenu.tsx index 0b5cdc8..fdbd54a 100644 --- a/components/PopupMenu.tsx +++ b/components/PopupMenu.tsx @@ -28,6 +28,10 @@ import { faCamera } from "@fortawesome/free-solid-svg-icons/faCamera"; import { faQrcode } from "@fortawesome/free-solid-svg-icons/faQrcode"; import { useError } from "@/hooks/useError"; import * as Linking from "expo-linking"; +import { + hasProblemDetails, + NOT_ACCEPTABLE_STATUS, +} from "@inrupt/solid-client-errors"; import { ThemedText } from "./ThemedText"; const { width } = Dimensions.get("window"); @@ -61,6 +65,15 @@ const PopupMenu: React.FC = ({ mutationFn: postFile, onSuccess: onUploadSuccess, onError: (error) => { + if ( + error && + hasProblemDetails(error) && + error.problemDetails.status === NOT_ACCEPTABLE_STATUS + ) { + // This is the expected behavior of the Solid server. The file has already been uploaded to Solid, even though the server returned a 406 error. + onUploadSuccess(); + return; + } console.debug("A non-HTTP error occurred.", error); showErrorMsg("Unable to save the file into your Wallet."); }, diff --git a/components/files/BottomModal.tsx b/components/files/BottomModal.tsx index 9c6dafe..e734fec 100644 --- a/components/files/BottomModal.tsx +++ b/components/files/BottomModal.tsx @@ -56,7 +56,9 @@ const BottomModal: React.FC = ({ const [isShowQRCode, setShowQRCode] = useState(false); const deleteMutation = useMutation({ mutationFn: deleteFile, - onSuccess: () => queryClient.refetchQueries({ queryKey: ["files"] }), + onSuccess: () => { + onDeleteSuccessfully?.(); + }, mutationKey: ["filesMutation"], }); const queryClient = useQueryClient(); @@ -105,11 +107,6 @@ const BottomModal: React.FC = ({ // eslint-disable-next-line no-console .catch(() => console.error("Error while deleting data")); onCloseModal(); - onDeleteSuccessfully?.(); - queryClient - .refetchQueries({ queryKey: ["files"] }) - // eslint-disable-next-line no-console - .catch(() => console.error("Error while refetching data")); }; const onShareViaQR = () => { diff --git a/package-lock.json b/package-lock.json index db2428e..b219e4a 100644 --- a/package-lock.json +++ b/package-lock.json @@ -17,7 +17,7 @@ "@inrupt/solid-client-errors": "^0.0.2", "@react-native-cookies/cookies": "^6.2.1", "@react-navigation/native": "^6.1.18", - "@tanstack/react-query": "^5.51.23", + "@tanstack/react-query": "^5.56.2", "date-fns": "^3.6.0", "expo": "~51.0.31", "expo-build-properties": "~0.12.5", @@ -42,7 +42,7 @@ "react-native-gesture-handler": "~2.16.1", "react-native-qrcode-svg": "^6.3.1", "react-native-reanimated": "~3.10.1", - "react-native-safe-area-context": "4.10.5", + "react-native-safe-area-context": "4.11.0", "react-native-screens": "3.31.1", "react-native-svg": "15.2.0", "react-native-svg-transformer": "^1.5.0", @@ -3227,7 +3227,9 @@ } }, "node_modules/@expo/vector-icons": { - "version": "14.0.2", + "version": "14.0.3", + "resolved": "https://registry.npmjs.org/@expo/vector-icons/-/vector-icons-14.0.3.tgz", + "integrity": "sha512-UJAKOXPPi6ez/1QZfoFVopCH3+c12Sw+T+IIVkvONCEN7zjN1fLxxWHkZ7Spz4WO5EH2ObtaJfCe/k4rw+ftxA==", "license": "MIT", "dependencies": { "prop-types": "^15.8.1" @@ -7100,7 +7102,9 @@ } }, "node_modules/@tanstack/query-core": { - "version": "5.51.21", + "version": "5.56.2", + "resolved": "https://registry.npmjs.org/@tanstack/query-core/-/query-core-5.56.2.tgz", + "integrity": "sha512-gor0RI3/R5rVV3gXfddh1MM+hgl0Z4G7tj6Xxpq6p2I03NGPaJ8dITY9Gz05zYYb/EJq9vPas/T4wn9EaDPd4Q==", "license": "MIT", "funding": { "type": "github", @@ -7108,17 +7112,19 @@ } }, "node_modules/@tanstack/react-query": { - "version": "5.51.23", + "version": "5.56.2", + "resolved": "https://registry.npmjs.org/@tanstack/react-query/-/react-query-5.56.2.tgz", + "integrity": "sha512-SR0GzHVo6yzhN72pnRhkEFRAHMsUo5ZPzAxfTMvUxFIDVS6W9LYUp6nXW3fcHVdg0ZJl8opSH85jqahvm6DSVg==", "license": "MIT", "dependencies": { - "@tanstack/query-core": "5.51.21" + "@tanstack/query-core": "5.56.2" }, "funding": { "type": "github", "url": "https://github.com/sponsors/tannerlinsley" }, "peerDependencies": { - "react": "^18.0.0" + "react": "^18 || ^19" } }, "node_modules/@testing-library/jest-native": { @@ -11563,9 +11569,9 @@ } }, "node_modules/expo": { - "version": "51.0.32", - "resolved": "https://registry.npmjs.org/expo/-/expo-51.0.32.tgz", - "integrity": "sha512-6GEhYvHRnyS/6BytQagGkClsaqbuwAtlN3A6oDfnNMRKLmz6NE/r+Rjg9zbQgUO6zigqb60Yj5lAX32DmixRDw==", + "version": "51.0.33", + "resolved": "https://registry.npmjs.org/expo/-/expo-51.0.33.tgz", + "integrity": "sha512-vAUZOU5RRfsLvOx9vaz0I7v9SK26cUPwvIcg1fwSURfaqVl2JDEUD0KHcSFeFeZvV7m7dX+zdH2ufHyzzQyayw==", "license": "MIT", "dependencies": { "@babel/runtime": "^7.20.0", @@ -11573,7 +11579,7 @@ "@expo/config": "9.0.3", "@expo/config-plugins": "8.0.8", "@expo/metro-config": "0.18.11", - "@expo/vector-icons": "^14.0.0", + "@expo/vector-icons": "^14.0.3", "babel-preset-expo": "~11.0.14", "expo-asset": "~10.0.10", "expo-file-system": "~17.0.1", @@ -18739,9 +18745,9 @@ } }, "node_modules/react-native-safe-area-context": { - "version": "4.10.5", - "resolved": "https://registry.npmjs.org/react-native-safe-area-context/-/react-native-safe-area-context-4.10.5.tgz", - "integrity": "sha512-Wyb0Nqw2XJ6oZxW/cK8k5q7/UAhg/wbEG6UVf89rQqecDZTDA5ic//P9J6VvJRVZerzGmxWQpVuM7f+PRYUM4g==", + "version": "4.11.0", + "resolved": "https://registry.npmjs.org/react-native-safe-area-context/-/react-native-safe-area-context-4.11.0.tgz", + "integrity": "sha512-Bg7bozxEB+ZS+H3tVYs5yY1cvxNXgR6nRQwpSMkYR9IN5CbxohLnSprrOPG/ostTCd4F6iCk0c51pExEhifSKQ==", "license": "MIT", "peerDependencies": { "react": "*", @@ -19518,18 +19524,116 @@ } }, "node_modules/serve-static": { - "version": "1.15.0", + "version": "1.16.2", + "resolved": "https://registry.npmjs.org/serve-static/-/serve-static-1.16.2.tgz", + "integrity": "sha512-VqpjJZKadQB/PEbEwvFdO43Ax5dFBZ2UECszz8bQ7pi7wt//PWe1P6MN7eCnjsatYtBT6EuiClbjSWP2WrIoTw==", "license": "MIT", "dependencies": { - "encodeurl": "~1.0.2", + "encodeurl": "~2.0.0", "escape-html": "~1.0.3", "parseurl": "~1.3.3", - "send": "0.18.0" + "send": "0.19.0" + }, + "engines": { + "node": ">= 0.8.0" + } + }, + "node_modules/serve-static/node_modules/debug": { + "version": "2.6.9", + "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", + "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", + "license": "MIT", + "dependencies": { + "ms": "2.0.0" + } + }, + "node_modules/serve-static/node_modules/debug/node_modules/ms": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", + "integrity": "sha512-Tpp60P6IUJDTuOq/5Z8cdskzJujfwqfOTkrwIwj7IRISpnkJnT6SyJ4PCPnGMoFjC9ddhal5KVIYtAt97ix05A==", + "license": "MIT" + }, + "node_modules/serve-static/node_modules/encodeurl": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/encodeurl/-/encodeurl-2.0.0.tgz", + "integrity": "sha512-Q0n9HRi4m6JuGIV1eFlmvJB7ZEVxu93IrMyiMsGC0lrMJMWzRgx6WGquyfQgZVb31vhGgXnfmPNNXmxnOkRBrg==", + "license": "MIT", + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/serve-static/node_modules/mime": { + "version": "1.6.0", + "resolved": "https://registry.npmjs.org/mime/-/mime-1.6.0.tgz", + "integrity": "sha512-x0Vn8spI+wuJ1O6S7gnbaQg8Pxh4NNHb7KSINmEWKiPE4RKOplvijn+NkmYmmRgP68mc70j2EbeTFRsrswaQeg==", + "license": "MIT", + "bin": { + "mime": "cli.js" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/serve-static/node_modules/ms": { + "version": "2.1.3", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", + "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==", + "license": "MIT" + }, + "node_modules/serve-static/node_modules/on-finished": { + "version": "2.4.1", + "resolved": "https://registry.npmjs.org/on-finished/-/on-finished-2.4.1.tgz", + "integrity": "sha512-oVlzkg3ENAhCk2zdv7IJwd/QUD4z2RxRwpkcGY8psCVcCYZNq4wYnVWALHM+brtuJjePWiYF/ClmuDr8Ch5+kg==", + "license": "MIT", + "dependencies": { + "ee-first": "1.1.1" + }, + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/serve-static/node_modules/send": { + "version": "0.19.0", + "resolved": "https://registry.npmjs.org/send/-/send-0.19.0.tgz", + "integrity": "sha512-dW41u5VfLXu8SJh5bwRmyYUbAoSB3c9uQh6L8h/KtsFREPWpbX1lrljJo186Jc4nmci/sGUZ9a0a0J2zgfq2hw==", + "license": "MIT", + "dependencies": { + "debug": "2.6.9", + "depd": "2.0.0", + "destroy": "1.2.0", + "encodeurl": "~1.0.2", + "escape-html": "~1.0.3", + "etag": "~1.8.1", + "fresh": "0.5.2", + "http-errors": "2.0.0", + "mime": "1.6.0", + "ms": "2.1.3", + "on-finished": "2.4.1", + "range-parser": "~1.2.1", + "statuses": "2.0.1" }, "engines": { "node": ">= 0.8.0" } }, + "node_modules/serve-static/node_modules/send/node_modules/encodeurl": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/encodeurl/-/encodeurl-1.0.2.tgz", + "integrity": "sha512-TPJXq8JqFaVYm2CWmPvnP2Iyo4ZSM7/QKcSmuMLDObfpH5fi7RUGmd/rTDf+rut/saiDiQEeVTNgAmJEdAOx0w==", + "license": "MIT", + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/serve-static/node_modules/statuses": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/statuses/-/statuses-2.0.1.tgz", + "integrity": "sha512-RwNA9Z/7PrK06rYLIzFMlaF+l73iwpzsqRIFgbMLbTcLD6cOao82TaWefPXQvB2fOC4AjuYSEndS7N/mTCbkdQ==", + "license": "MIT", + "engines": { + "node": ">= 0.8" + } + }, "node_modules/set-blocking": { "version": "2.0.0", "license": "ISC" diff --git a/package.json b/package.json index 3898bdc..3e31c5d 100644 --- a/package.json +++ b/package.json @@ -26,7 +26,7 @@ "@inrupt/solid-client-errors": "^0.0.2", "@react-native-cookies/cookies": "^6.2.1", "@react-navigation/native": "^6.1.18", - "@tanstack/react-query": "^5.51.23", + "@tanstack/react-query": "^5.56.2", "date-fns": "^3.6.0", "expo": "~51.0.31", "expo-build-properties": "~0.12.5", @@ -51,7 +51,7 @@ "react-native-gesture-handler": "~2.16.1", "react-native-qrcode-svg": "^6.3.1", "react-native-reanimated": "~3.10.1", - "react-native-safe-area-context": "4.10.5", + "react-native-safe-area-context": "4.11.0", "react-native-screens": "3.31.1", "react-native-svg": "15.2.0", "react-native-svg-transformer": "^1.5.0",