mirror of
https://github.com/Sea-Haven-Industries/proposal-system.git
synced 2026-10-04 21:52:03 +00:00
Fix launch crash on iOS 26: update netinfo and add error handling
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).
This commit is contained in:
parent
042339948c
commit
a9b720ee08
3 changed files with 15 additions and 13 deletions
8
mobile/package-lock.json
generated
8
mobile/package-lock.json
generated
|
|
@ -10,7 +10,7 @@
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@proposal-system/api-contracts": "file:../shared/api-contracts",
|
"@proposal-system/api-contracts": "file:../shared/api-contracts",
|
||||||
"@react-native-async-storage/async-storage": "^2.1.0",
|
"@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/bottom-tabs": "^7.2.0",
|
||||||
"@react-navigation/native": "^7.0.0",
|
"@react-navigation/native": "^7.0.0",
|
||||||
"@react-navigation/native-stack": "^7.2.0",
|
"@react-navigation/native-stack": "^7.2.0",
|
||||||
|
|
@ -1707,9 +1707,9 @@
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/@react-native-community/netinfo": {
|
"node_modules/@react-native-community/netinfo": {
|
||||||
"version": "11.5.2",
|
"version": "12.0.1",
|
||||||
"resolved": "https://registry.npmjs.org/@react-native-community/netinfo/-/netinfo-11.5.2.tgz",
|
"resolved": "https://registry.npmjs.org/@react-native-community/netinfo/-/netinfo-12.0.1.tgz",
|
||||||
"integrity": "sha512-/g0m65BtX9HU+bPiCH2517bOHpEIUsGrWFXDzi1a5nNKn5KujQgm04WhL7/OSXWKHyrT8VVtUoJA0XKRxueBpQ==",
|
"integrity": "sha512-P/3caXIvfYSJG8AWJVefukg+ZGRPs+M4Lp3pNJtgcTYoJxCjWrKQGNnCkj/Cz//zWa/avGed0i/wzm0T8vV2IQ==",
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"peerDependencies": {
|
"peerDependencies": {
|
||||||
"react": "*",
|
"react": "*",
|
||||||
|
|
|
||||||
|
|
@ -11,7 +11,7 @@
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@proposal-system/api-contracts": "file:../shared/api-contracts",
|
"@proposal-system/api-contracts": "file:../shared/api-contracts",
|
||||||
"@react-native-async-storage/async-storage": "^2.1.0",
|
"@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/bottom-tabs": "^7.2.0",
|
||||||
"@react-navigation/native": "^7.0.0",
|
"@react-navigation/native": "^7.0.0",
|
||||||
"@react-navigation/native-stack": "^7.2.0",
|
"@react-navigation/native-stack": "^7.2.0",
|
||||||
|
|
|
||||||
|
|
@ -41,14 +41,16 @@ function AuthBootstrap({ children }: { children: React.ReactNode }) {
|
||||||
if (state.isConnected) {
|
if (state.isConnected) {
|
||||||
processOfflineQueue((data) =>
|
processOfflineQueue((data) =>
|
||||||
proposalsApi.create(data as CreateProposalRequest),
|
proposalsApi.create(data as CreateProposalRequest),
|
||||||
).then((count) => {
|
)
|
||||||
if (count > 0) {
|
.then((count) => {
|
||||||
Alert.alert(
|
if (count > 0) {
|
||||||
'Synced',
|
Alert.alert(
|
||||||
`${count} offline proposal${count > 1 ? 's' : ''} submitted.`,
|
'Synced',
|
||||||
);
|
`${count} offline proposal${count > 1 ? 's' : ''} submitted.`,
|
||||||
}
|
);
|
||||||
});
|
}
|
||||||
|
})
|
||||||
|
.catch(() => {});
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
return unsubscribe;
|
return unsubscribe;
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue