Page MenuHomePhabricator

D12085.id40328.diff
No OneTemporary

D12085.id40328.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:41 AM (20 h, 56 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2596335
Default Alt Text
D12085.id40328.diff (3 KB)

Event Timeline