Page MenuHomePhabricator

D12085.id40309.diff
No OneTemporary

D12085.id40309.diff

diff --git a/native/account/registration/registration-server-call.js b/native/account/registration/registration-server-call.js
--- a/native/account/registration/registration-server-call.js
+++ b/native/account/registration/registration-server-call.js
@@ -266,12 +266,22 @@
urlPrefixOverride: keyserverURL,
});
} catch (e) {
- Alert.alert(
- UnknownErrorAlertDetails.title,
- UnknownErrorAlertDetails.message,
- [{ text: 'OK', onPress: onAlertAcknowledged }],
- { cancelable: !onAlertAcknowledged },
- );
+ const messageForException = getMessageForException(e);
+ if (messageForException === 'client_version_unsupported') {
+ Alert.alert(
+ AppOutOfDateAlertDetails.title,
+ AppOutOfDateAlertDetails.message,
+ [{ text: 'OK', onPress: onAlertAcknowledged }],
+ { cancelable: !onAlertAcknowledged },
+ );
+ } else {
+ Alert.alert(
+ UnknownErrorAlertDetails.title,
+ UnknownErrorAlertDetails.message,
+ [{ text: 'OK', onPress: onAlertAcknowledged }],
+ { cancelable: !onAlertAcknowledged },
+ );
+ }
throw e;
}
} else {
@@ -286,6 +296,13 @@
const messageForException = getMessageForException(e);
if (messageForException === 'nonce expired') {
onNonceExpired();
+ } else if (messageForException === 'Unsupported version') {
+ Alert.alert(
+ AppOutOfDateAlertDetails.title,
+ AppOutOfDateAlertDetails.message,
+ [{ text: 'OK', onPress: onAlertAcknowledged }],
+ { cancelable: !onAlertAcknowledged },
+ );
} else {
Alert.alert(
UnknownErrorAlertDetails.title,
@@ -409,15 +426,27 @@
reject,
});
} catch (keyserverAuthException) {
+ const messageForException = getMessageForException(
+ keyserverAuthException,
+ );
const discardIdentityAccountPromise = (async () => {
try {
const deletionResult = await deleteDiscardedIdentityAccount();
- Alert.alert(
- UnknownErrorAlertDetails.title,
- UnknownErrorAlertDetails.message,
- [{ text: 'OK', onPress: onAlertAcknowledged }],
- { cancelable: !onAlertAcknowledged },
- );
+ if (messageForException === 'client_version_unsupported') {
+ Alert.alert(
+ AppOutOfDateAlertDetails.title,
+ AppOutOfDateAlertDetails.message,
+ [{ text: 'OK', onPress: onAlertAcknowledged }],
+ { cancelable: !onAlertAcknowledged },
+ );
+ } else {
+ Alert.alert(
+ UnknownErrorAlertDetails.title,
+ UnknownErrorAlertDetails.message,
+ [{ text: 'OK', onPress: onAlertAcknowledged }],
+ { cancelable: !onAlertAcknowledged },
+ );
+ }
return deletionResult;
} catch (deleteException) {
Alert.alert(

File Metadata

Mime Type
text/plain
Expires
Fri, Nov 29, 9:39 AM (20 h, 47 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2596585
Default Alt Text
D12085.id40309.diff (3 KB)

Event Timeline