From a9b720ee0839954bfbb9e5b0ab8820f2a1f52763 Mon Sep 17 00:00:00 2001 From: Adam Moussa <166072409+amoussa1229@users.noreply.github.com> Date: Tue, 19 May 2026 19:54:13 -0400 Subject: [PATCH] Fix launch crash on iOS 26: update netinfo and add error handling MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Crash log showed RCTFatal from an unhandled promise rejection during startup. The NetInfo listener fires immediately and processOfflineQueue had no .catch() — fatal in production RN. Also updated @react-native-community/netinfo from 11.x to 12.x because 11.x uses subscriberCellularProvider (deprecated iOS 12, likely removed in iOS 26). --- mobile/package-lock.json | 8 ++++---- mobile/package.json | 2 +- mobile/src/App.tsx | 18 ++++++++++-------- 3 files changed, 15 insertions(+), 13 deletions(-) diff --git a/mobile/package-lock.json b/mobile/package-lock.json index bb4e78a..036633c 100644 --- a/mobile/package-lock.json +++ b/mobile/package-lock.json @@ -10,7 +10,7 @@ "dependencies": { "@proposal-system/api-contracts": "file:../shared/api-contracts", "@react-native-async-storage/async-storage": "^2.1.0", - "@react-native-community/netinfo": "^11.4.0", + "@react-native-community/netinfo": "^12.0.1", "@react-navigation/bottom-tabs": "^7.2.0", "@react-navigation/native": "^7.0.0", "@react-navigation/native-stack": "^7.2.0", @@ -1707,9 +1707,9 @@ } }, "node_modules/@react-native-community/netinfo": { - "version": "11.5.2", - "resolved": "https://registry.npmjs.org/@react-native-community/netinfo/-/netinfo-11.5.2.tgz", - "integrity": "sha512-/g0m65BtX9HU+bPiCH2517bOHpEIUsGrWFXDzi1a5nNKn5KujQgm04WhL7/OSXWKHyrT8VVtUoJA0XKRxueBpQ==", + "version": "12.0.1", + "resolved": "https://registry.npmjs.org/@react-native-community/netinfo/-/netinfo-12.0.1.tgz", + "integrity": "sha512-P/3caXIvfYSJG8AWJVefukg+ZGRPs+M4Lp3pNJtgcTYoJxCjWrKQGNnCkj/Cz//zWa/avGed0i/wzm0T8vV2IQ==", "license": "MIT", "peerDependencies": { "react": "*", diff --git a/mobile/package.json b/mobile/package.json index 856a784..90b4790 100644 --- a/mobile/package.json +++ b/mobile/package.json @@ -11,7 +11,7 @@ "dependencies": { "@proposal-system/api-contracts": "file:../shared/api-contracts", "@react-native-async-storage/async-storage": "^2.1.0", - "@react-native-community/netinfo": "^11.4.0", + "@react-native-community/netinfo": "^12.0.1", "@react-navigation/bottom-tabs": "^7.2.0", "@react-navigation/native": "^7.0.0", "@react-navigation/native-stack": "^7.2.0", diff --git a/mobile/src/App.tsx b/mobile/src/App.tsx index 00ff3f4..026dbce 100644 --- a/mobile/src/App.tsx +++ b/mobile/src/App.tsx @@ -41,14 +41,16 @@ function AuthBootstrap({ children }: { children: React.ReactNode }) { if (state.isConnected) { processOfflineQueue((data) => proposalsApi.create(data as CreateProposalRequest), - ).then((count) => { - if (count > 0) { - Alert.alert( - 'Synced', - `${count} offline proposal${count > 1 ? 's' : ''} submitted.`, - ); - } - }); + ) + .then((count) => { + if (count > 0) { + Alert.alert( + 'Synced', + `${count} offline proposal${count > 1 ? 's' : ''} submitted.`, + ); + } + }) + .catch(() => {}); } }); return unsubscribe;