fix: Catch cloud request errors (#5312)
This commit is contained in:
parent
ebcce11342
commit
629b8727d2
|
@ -147,7 +147,7 @@ android {
|
|||
minSdkVersion rootProject.ext.minSdkVersion
|
||||
targetSdkVersion rootProject.ext.targetSdkVersion
|
||||
versionCode VERSIONCODE as Integer
|
||||
versionName "4.42.0"
|
||||
versionName "4.42.2"
|
||||
vectorDrawables.useSupportLibrary = true
|
||||
if (!isFoss) {
|
||||
manifestPlaceholders = [BugsnagAPIKey: BugsnagAPIKey as String]
|
||||
|
|
|
@ -10,6 +10,7 @@ import { store } from '../store/auxStore';
|
|||
import I18n from '../../i18n';
|
||||
import { SIGNED_SUPPORTED_VERSIONS_PUBLIC_KEY } from '../constants';
|
||||
import { getServerById } from '../database/services/Server';
|
||||
import log from './helpers/log';
|
||||
|
||||
interface IServerInfoFailure {
|
||||
success: false;
|
||||
|
@ -75,6 +76,14 @@ export async function getServerInfo(server: string): Promise<TServerInfoResult>
|
|||
|
||||
const cloudInfo = await getCloudInfo(server);
|
||||
|
||||
// Allows airgapped servers to use the app until enforcementStartDate
|
||||
if (!cloudInfo) {
|
||||
return {
|
||||
...jsonRes,
|
||||
success: true
|
||||
};
|
||||
}
|
||||
|
||||
// Makes use of signed JWT to get supported versions
|
||||
const supportedVersionsCloud = verifyJWT(cloudInfo?.signed);
|
||||
|
||||
|
@ -119,7 +128,12 @@ const getUniqueId = async (server: string): Promise<string> => {
|
|||
};
|
||||
|
||||
export const getCloudInfo = async (domain: string): Promise<TCloudInfo | null> => {
|
||||
const uniqueId = await getUniqueId(domain);
|
||||
const response = await getSupportedVersionsCloud(uniqueId, domain);
|
||||
return response.json() as unknown as TCloudInfo;
|
||||
try {
|
||||
const uniqueId = await getUniqueId(domain);
|
||||
const response = await getSupportedVersionsCloud(uniqueId, domain);
|
||||
return response.json() as unknown as TCloudInfo;
|
||||
} catch (e) {
|
||||
log(e);
|
||||
return null;
|
||||
}
|
||||
};
|
||||
|
|
|
@ -1760,7 +1760,7 @@
|
|||
INFOPLIST_FILE = NotificationService/Info.plist;
|
||||
IPHONEOS_DEPLOYMENT_TARGET = 12.0;
|
||||
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @executable_path/../../Frameworks";
|
||||
MARKETING_VERSION = 4.42.0;
|
||||
MARKETING_VERSION = 4.42.2;
|
||||
MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE;
|
||||
MTL_FAST_MATH = YES;
|
||||
OTHER_SWIFT_FLAGS = "$(inherited) -D EXPO_CONFIGURATION_DEBUG";
|
||||
|
@ -1799,7 +1799,7 @@
|
|||
INFOPLIST_FILE = NotificationService/Info.plist;
|
||||
IPHONEOS_DEPLOYMENT_TARGET = 12.0;
|
||||
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @executable_path/../../Frameworks";
|
||||
MARKETING_VERSION = 4.42.0;
|
||||
MARKETING_VERSION = 4.42.2;
|
||||
MTL_FAST_MATH = YES;
|
||||
OTHER_SWIFT_FLAGS = "$(inherited) -D EXPO_CONFIGURATION_RELEASE";
|
||||
PRODUCT_BUNDLE_IDENTIFIER = chat.rocket.reactnative.NotificationService;
|
||||
|
|
|
@ -26,7 +26,7 @@
|
|||
<key>CFBundlePackageType</key>
|
||||
<string>APPL</string>
|
||||
<key>CFBundleShortVersionString</key>
|
||||
<string>4.42.0</string>
|
||||
<string>4.42.2</string>
|
||||
<key>CFBundleSignature</key>
|
||||
<string>????</string>
|
||||
<key>CFBundleURLTypes</key>
|
||||
|
|
|
@ -26,7 +26,7 @@
|
|||
<key>CFBundlePackageType</key>
|
||||
<string>XPC!</string>
|
||||
<key>CFBundleShortVersionString</key>
|
||||
<string>4.42.0</string>
|
||||
<string>4.42.2</string>
|
||||
<key>CFBundleVersion</key>
|
||||
<string>1</string>
|
||||
<key>KeychainGroup</key>
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"name": "rocket-chat-reactnative",
|
||||
"version": "4.42.0",
|
||||
"version": "4.42.2",
|
||||
"private": true,
|
||||
"scripts": {
|
||||
"start": "react-native start",
|
||||
|
|
Loading…
Reference in New Issue