diff --git a/native/account/restore-backup-error-screen.react.js b/native/account/restore-backup-error-screen.react.js --- a/native/account/restore-backup-error-screen.react.js +++ b/native/account/restore-backup-error-screen.react.js @@ -106,8 +106,15 @@ navigation.navigate(LoggedOutModalRouteName); }, [navigation, loggedIn, logOut, dispatch, dispatchActionPromise]); - const deviceTypeWarning = React.useMemo(() => { - if (deviceType === 'secondary') { + const userFriendlyErrorMessage = React.useMemo(() => { + if (errorDetails === 'no_backup_data') { + return ( + + Your user data backup is not ready yet. Make sure the Comm app on your + primary device has been updated to the latest version, then try again. + + ); + } else if (deviceType === 'secondary') { return ( Your backup appears to be corrupt. Be careful with your primary @@ -121,13 +128,13 @@ ); } - }, [deviceType, styles.section]); + }, [deviceType, styles.section, errorDetails]); return ( Restoration failed - {deviceTypeWarning} + {userFriendlyErrorMessage} Error message: {errorDetails} diff --git a/shared/backup_client/src/lib.rs b/shared/backup_client/src/lib.rs --- a/shared/backup_client/src/lib.rs +++ b/shared/backup_client/src/lib.rs @@ -141,6 +141,9 @@ } let response = request.send().await?; + if response.status() == StatusCode::NOT_FOUND { + return Err(Error::NoBackupData); + } let result = response.error_for_status()?.bytes().await?.to_vec(); Ok(result) @@ -402,6 +405,8 @@ WSClosed, Unauthenticated, InvalidRequest, + #[display(fmt = "no_backup_data")] + NoBackupData, } impl Error { diff --git a/web/account/restoration.react.js b/web/account/restoration.react.js --- a/web/account/restoration.react.js +++ b/web/account/restoration.react.js @@ -160,6 +160,24 @@ } }, [dispatch, dispatchActionPromise, loggedIn, logOut]); + const userFriendlyErrorMessage = React.useMemo(() => { + if (errorDetails === 'no_backup_data') { + return ( + + Your user data backup is not ready yet. Make sure the Comm app on your + primary device has been updated to the latest version, then try again. + + ); + } else { + return ( + + Your backup appears to be corrupt. Be careful with your primary + device, as you may lose data if you log out of it at this time. + + ); + } + }, [errorDetails]); + return ( - - Your backup appears to be corrupt. Be careful with your primary - device, as you may lose data if you log out of it at this time. - + {userFriendlyErrorMessage} Error message: {errorDetails}