diff --git a/app/constants/view.js b/app/constants/view.js index 2a3587960..88d7a1c04 100644 --- a/app/constants/view.js +++ b/app/constants/view.js @@ -112,10 +112,10 @@ const ViewTypes = keyMirror({ }); const RequiredServer = { - FULL_VERSION: 5.31, + FULL_VERSION: '5.31.3', MAJOR_VERSION: 5, MIN_VERSION: 31, - PATCH_VERSION: 0, + PATCH_VERSION: 3, }; export default { diff --git a/app/mm-redux/selectors/entities/teams.ts b/app/mm-redux/selectors/entities/teams.ts index 419af3b2f..f095f41f6 100644 --- a/app/mm-redux/selectors/entities/teams.ts +++ b/app/mm-redux/selectors/entities/teams.ts @@ -110,7 +110,7 @@ export const getMyTeams = reselect.createSelector( getTeams, getTeamMemberships, (teams, members) => { - return Object.values(teams).filter((t) => members[t.id] && t.delete_at === 0); + return Object.values(teams).filter((t) => t && members[t.id] && t.delete_at === 0); }, ); diff --git a/app/store/mmkv_adapter.ts b/app/store/mmkv_adapter.ts index 36bfd6b7c..13f449a43 100644 --- a/app/store/mmkv_adapter.ts +++ b/app/store/mmkv_adapter.ts @@ -43,19 +43,16 @@ export default async function getStorage(identifier = 'default') { ): Promise => { return new Promise((resolve, reject) => { checkValidInput(key); - MMKV.getString(key, (error: Error, result: string) => { - if (error) { - if (callback) { - callback(error, null); - } - reject(error); - return; - } - + MMKV.getStringAsync(key).then((result: string) => { if (callback) { callback(null, result); } resolve(JSON.parse(result)); + }).catch((error: Error) => { + if (callback) { + callback(error, null); + } + reject(error); }); }); }, @@ -67,14 +64,19 @@ export default async function getStorage(identifier = 'default') { error: Error | null ) => void | null | undefined, ): Promise => { - return new Promise((resolve) => { + return new Promise((resolve, reject) => { checkValidInput(key, value); - MMKV.setString(key, JSON.stringify(value)); - if (callback) { - callback(null); - } - - resolve(null); + MMKV.setStringAsync(key, JSON.stringify(value)).then(() => { + if (callback) { + callback(null); + } + resolve(null); + }).catch((error: Error) => { + if (callback) { + callback(error); + } + reject(error); + }); }); }, diff --git a/app/utils/supported_server.ts b/app/utils/supported_server.ts index 7225d27bb..6b563571a 100644 --- a/app/utils/supported_server.ts +++ b/app/utils/supported_server.ts @@ -36,7 +36,7 @@ function unsupportedServerAdminAlert(formatMessage: FormatMessageType) { text: formatMessage({id: 'mobile.server_upgrade.learn_more', defaultMessage: 'Learn More'}), style: 'cancel', onPress: () => { - const url = 'https://mattermost.com/blog/support-for-esr-5-9-has-ended/'; + const url = 'https://docs.mattermost.com/administration/release-lifecycle.html'; const onError = () => { Alert.alert( formatMessage({ diff --git a/ios/Podfile.lock b/ios/Podfile.lock index dfd9a6a68..60a1ed0d6 100644 --- a/ios/Podfile.lock +++ b/ios/Podfile.lock @@ -246,7 +246,7 @@ PODS: - React-Core - react-native-local-auth (1.6.0): - React - - react-native-mmkv-storage (0.5.3): + - react-native-mmkv-storage (0.4.4): - MMKV (= 1.2.7) - React-Core - react-native-netinfo (6.0.0): @@ -683,7 +683,7 @@ SPEC CHECKSUMS: react-native-hw-keyboard-event: b517cefb8d5c659a38049c582de85ff43337dc53 react-native-image-picker: 32d1ad2c0024ca36161ae0d5c2117e2d6c441f11 react-native-local-auth: 359af242caa1e5c501ac9dfe33b1e238ad8f08c6 - react-native-mmkv-storage: b8c0ce10551ecf9c270477606aa2cab763011097 + react-native-mmkv-storage: 5ed53d7c4ac98f1ef184404e781f63a998f98121 react-native-netinfo: 34f4d7a42f49157f3b45c14217d256bce7dc9682 react-native-notifications: e914ff49de3b2268cfa1b5e2ad21fd27c36d5b7b react-native-passcode-status: 88c4f6e074328bc278bd127646b6c694ad5a530a diff --git a/package-lock.json b/package-lock.json index 75d0989ad..9af8a01e9 100644 --- a/package-lock.json +++ b/package-lock.json @@ -20978,9 +20978,9 @@ "integrity": "sha512-4Ii7lqiD9iL0LxTWifAiEsDcDPpvos/29fEVkHxgEDD7J5f+NROMkFSFomKgz1Cab1TmN5mau3o8yFmYrPFcnw==" }, "react-native-mmkv-storage": { - "version": "0.5.3", - "resolved": "https://registry.npmjs.org/react-native-mmkv-storage/-/react-native-mmkv-storage-0.5.3.tgz", - "integrity": "sha512-6JAD3IYfpdWTiQZWiKSQn4RAjbxVhyziZncvwPY2ToO/o/DiRdW4fce+ZJ755KpfBfG6EcB3is5sX+LXIJqVkA==" + "version": "0.4.4", + "resolved": "https://registry.npmjs.org/react-native-mmkv-storage/-/react-native-mmkv-storage-0.4.4.tgz", + "integrity": "sha512-NuLKc9C0xLPgteQpieGMGbkNm8A0ma8rzfErQKZbS4KLD2bWQ8c1rZ71JgGBiJrCffpDy1BNZt86DZtPl7djXw==" }, "react-native-modal": { "version": "11.7.0", diff --git a/package.json b/package.json index f578e918c..3cb94237b 100644 --- a/package.json +++ b/package.json @@ -54,7 +54,7 @@ "react-native-linear-gradient": "2.5.6", "react-native-local-auth": "1.6.0", "react-native-localize": "2.0.2", - "react-native-mmkv-storage": "0.5.3", + "react-native-mmkv-storage": "0.4.4", "react-native-navigation": "7.11.3", "react-native-notifications": "3.4.2", "react-native-passcode-status": "1.1.2", diff --git a/patches/react-native-mmkv-storage+0.4.4.patch b/patches/react-native-mmkv-storage+0.4.4.patch new file mode 100644 index 000000000..74da49f49 --- /dev/null +++ b/patches/react-native-mmkv-storage+0.4.4.patch @@ -0,0 +1,19 @@ +diff --git a/node_modules/react-native-mmkv-storage/ios/MMKVStorage.m b/node_modules/react-native-mmkv-storage/ios/MMKVStorage.m +index 2875bda..8235771 100644 +--- a/node_modules/react-native-mmkv-storage/ios/MMKVStorage.m ++++ b/node_modules/react-native-mmkv-storage/ios/MMKVStorage.m +@@ -45,10 +45,10 @@ - (id)init + { + self = [super init]; + if (self) { +- NSArray *paths = NSSearchPathForDirectoriesInDomains(NSLibraryDirectory, NSUserDomainMask, YES); +- NSString *libraryPath = (NSString *) [paths firstObject]; +- NSString *rootDir = [libraryPath stringByAppendingPathComponent:@"mmkv"]; +- [MMKV initializeMMKV:rootDir]; ++ NSBundle *bundle = [NSBundle mainBundle]; ++ NSString *APP_GROUP_ID = [bundle objectForInfoDictionaryKey:@"AppGroupIdentifier"]; ++ NSString *groupDir = [[NSFileManager defaultManager] containerURLForSecurityApplicationGroupIdentifier:APP_GROUP_ID].path; ++ [MMKV initializeMMKV:nil groupDir:groupDir logLevel:MMKVLogInfo]; + + secureStorage = [[SecureStorage alloc]init]; + IdStore = [[IDStore alloc] initWithMMKV:[MMKV mmkvWithID:@"mmkvIdStore"]]; diff --git a/patches/react-native-mmkv-storage+0.5.3.patch b/patches/react-native-mmkv-storage+0.5.3.patch deleted file mode 100644 index 344ba72dd..000000000 --- a/patches/react-native-mmkv-storage+0.5.3.patch +++ /dev/null @@ -1,22 +0,0 @@ -diff --git a/node_modules/react-native-mmkv-storage/ios/MMKVNative.mm b/node_modules/react-native-mmkv-storage/ios/MMKVNative.mm -index 299942e..9c5b3f9 100644 ---- a/node_modules/react-native-mmkv-storage/ios/MMKVNative.mm -+++ b/node_modules/react-native-mmkv-storage/ios/MMKVNative.mm -@@ -690,12 +690,12 @@ static void install(jsi::Runtime & jsiRuntime) - - mmkvInstances = [NSMutableDictionary dictionary]; - -- NSArray *paths = NSSearchPathForDirectoriesInDomains(NSLibraryDirectory, NSUserDomainMask, YES); -- NSString *libraryPath = (NSString *) [paths firstObject]; -- NSString *rootDir = [libraryPath stringByAppendingPathComponent:@"mmkv"]; -- rPath = rootDir; -+ NSBundle *bundle = [NSBundle mainBundle]; -+ NSString *APP_GROUP_ID = [bundle objectForInfoDictionaryKey:@"AppGroupIdentifier"]; -+ NSString *groupDir = [[NSFileManager defaultManager] containerURLForSecurityApplicationGroupIdentifier:APP_GROUP_ID].path; -+ rPath = groupDir; - _secureStorage = [[SecureStorage alloc] init]; -- [MMKV initializeMMKV:rootDir]; -+ [MMKV initializeMMKV:nil groupDir:groupDir logLevel:MMKVLogInfo]; - install(*(jsi::Runtime *)cxxBridge.runtime); - [self migrate]; -