Please provide the following:
- SDK Version: 42
- Platforms(Android/iOS/web/all): iOS and Android
- Add the appropriate “Tag” based on what Expo library you have a question on.
Within my react code, every minute I’m having the phone run Updates.checkForUpdateAsync()
to check to see if there are any updates. If so, it let’s the person know and then applies the update. I recently put some logging in place to see if there were any errors around this code and a ton of Manifest verification failed
(for iOS) and Failed to download manifest from URL
(for Android) errors are streaming in. Sometimes it works, sometimes it doesn’t. The code I’m using looks like this:
React.useEffect(() => {
let timeoutId: number;
const updateChecker = async () => {
try {
const update = await Updates.checkForUpdateAsync();
if (update.isAvailable) {
await Updates.fetchUpdateAsync();
Alert.alert(
'Update Available',
'An update has downloaded and will now be applied.',
[{
text: 'OK',
onPress: () => {
Updates.reloadAsync();
},
}],
);
} else {
timeoutId = setTimeout(updateChecker, 1 * 60 * 1e3); // every 1 min.
}
} catch (e: any) {
// Sometimes Expo Update has issues with checking if there is a new
// version and returns these intermittent errors. Ignore these two
// particular errors and just keep trying. We also want to report
// to Sentry just to see how bad this really is.
if (
e.message === 'Manifest verification failed'
|| e.message.startsWith('Failed to download manifest from URL')
) {
Sentry.captureException(e);
timeoutId = setTimeout(updateChecker, 1 * 60 * 1e3); // every 1 min.
// Expo Update doesn't work in dev, so just ignore these particular errors and send
// everything else to Sentry
} else if (!e.message.startsWith('You cannot check for updates in development mode.')) {
Sentry.captureException(e);
}
}
};
updateChecker();
return () => {
if (timeoutId) {
clearTimeout(timeoutId);
}
};
}, []);
Is it possible the endpoint for pulling the manifest is not reliable and is somehow timing out?