From 15e3cf9c5a38e08e2565165e59f91d2085379815 Mon Sep 17 00:00:00 2001 From: Mattermost Build Date: Tue, 27 Jun 2023 17:47:06 +0300 Subject: [PATCH 1/7] Use network APIClient reactContext if already set (#7426) (#7428) (cherry picked from commit 72f7c639c77eb6b9d9b0f1b05747f6ae3d362fee) Co-authored-by: Elias Nahum --- android/app/src/main/java/com/mattermost/helpers/Network.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/android/app/src/main/java/com/mattermost/helpers/Network.java b/android/app/src/main/java/com/mattermost/helpers/Network.java index c1622459b3..de88f8629c 100644 --- a/android/app/src/main/java/com/mattermost/helpers/Network.java +++ b/android/app/src/main/java/com/mattermost/helpers/Network.java @@ -21,7 +21,7 @@ public class Network { private static final Promise emptyPromise = new ResolvePromise(); public static void init(Context context) { - final ReactApplicationContext reactContext = new ReactApplicationContext(context); + final ReactApplicationContext reactContext = (APIClientModule.context == null) ? new ReactApplicationContext(context) : APIClientModule.context; clientModule = new APIClientModule(reactContext); createClientOptions(); } From 175680da453e53af91da83a721c511687486762a Mon Sep 17 00:00:00 2001 From: Mattermost Build Date: Wed, 28 Jun 2023 14:22:44 +0300 Subject: [PATCH 2/7] Fix problems related to closing react but keeping other state (#7405) (#7431) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit (cherry picked from commit 0a3f5e59140971504e3277927af470b05ab453ab) Co-authored-by: Daniel Espino García --- app/actions/remote/notifications.ts | 7 ++++++ app/init/app.ts | 36 +++++++++++++++++++++++------ app/init/launch.ts | 4 +++- app/screens/navigation.ts | 6 +++++ app/store/ephemeral_store.ts | 10 ++++++++ app/store/navigation_store.ts | 7 ++++++ index.ts | 3 +-- 7 files changed, 63 insertions(+), 10 deletions(-) diff --git a/app/actions/remote/notifications.ts b/app/actions/remote/notifications.ts index f90bd1a87b..0c91656b45 100644 --- a/app/actions/remote/notifications.ts +++ b/app/actions/remote/notifications.ts @@ -180,6 +180,13 @@ export const backgroundNotification = async (serverUrl: string, notification: No }; export const openNotification = async (serverUrl: string, notification: NotificationWithData) => { + // Wait for initial launch to kick in if needed + await new Promise((r) => setTimeout(r, 500)); + + if (EphemeralStore.getProcessingNotification() === notification.identifier) { + return {}; + } + EphemeralStore.setNotificationTapped(true); const channelId = notification.payload!.channel_id!; diff --git a/app/init/app.ts b/app/init/app.ts index 0b8e8a7fba..e04fc54c64 100644 --- a/app/init/app.ts +++ b/app/init/app.ts @@ -12,8 +12,17 @@ import SessionManager from '@managers/session_manager'; import WebsocketManager from '@managers/websocket_manager'; import {registerScreens} from '@screens/index'; import {registerNavigationListeners} from '@screens/navigation'; +import EphemeralStore from '@store/ephemeral_store'; +import NavigationStore from '@store/navigation_store'; + +// Controls whether the main initialization (database, etc...) is done, either on app launch +// or on the Share Extension, for example. +let baseAppInitialized = false; + +// Controls whether the app initialization (websockets, screen listeners, etc...) is done, mainly +// on app launch +let mainAppInitialized = false; -let alreadyInitialized = false; let serverCredentials: ServerCredential[]; // Fallback Polyfill for Promise.allSettle @@ -31,8 +40,8 @@ Promise.allSettled = Promise.allSettled || ((promises: Array>) => )); export async function initialize() { - if (!alreadyInitialized) { - alreadyInitialized = true; + if (!baseAppInitialized) { + baseAppInitialized = true; serverCredentials = await getAllServerCredentials(); const serverUrls = serverCredentials.map((credential) => credential.serverUrl); @@ -46,12 +55,25 @@ export async function initialize() { } export async function start() { + if (baseAppInitialized) { + // Clean relevant information on ephemeral stores + NavigationStore.reset(); + EphemeralStore.setCurrentThreadId(''); + EphemeralStore.setProcessingNotification(''); + } + await initialize(); - PushNotifications.init(serverCredentials.length > 0); + if (!mainAppInitialized) { + mainAppInitialized = true; + + PushNotifications.init(serverCredentials.length > 0); + + registerNavigationListeners(); + registerScreens(); + + await WebsocketManager.init(serverCredentials); + } - registerNavigationListeners(); - registerScreens(); - await WebsocketManager.init(serverCredentials); initialLaunch(); } diff --git a/app/init/launch.ts b/app/init/launch.ts index f5f6ebd4b0..081c6aeeae 100644 --- a/app/init/launch.ts +++ b/app/init/launch.ts @@ -42,7 +42,9 @@ export const initialLaunch = async () => { tapped = delivered.find((d) => (d as unknown as NotificationData).ack_id === notification?.payload.ack_id) == null; } if (initialNotificationTypes.includes(notification?.payload?.type) && tapped) { - return launchAppFromNotification(convertToNotificationData(notification!), true); + const notificationData = convertToNotificationData(notification!); + EphemeralStore.setProcessingNotification(notificationData.identifier); + return launchAppFromNotification(notificationData, true); } const coldStart = notification ? (tapped || AppState.currentState === 'active') : true; diff --git a/app/screens/navigation.ts b/app/screens/navigation.ts index cd85c33703..b1f02203ab 100644 --- a/app/screens/navigation.ts +++ b/app/screens/navigation.ts @@ -14,6 +14,7 @@ import {NOT_READY} from '@constants/screens'; import {getDefaultThemeByAppearance} from '@context/theme'; import EphemeralStore from '@store/ephemeral_store'; import NavigationStore from '@store/navigation_store'; +import {logError} from '@utils/log'; import {appearanceControlledScreens, mergeNavigationOptions} from '@utils/navigation'; import {changeOpacity, setNavigatorStyles} from '@utils/theme'; @@ -449,6 +450,11 @@ export function goToScreen(name: AvailableScreens, title: string, passProps = {} const theme = getThemeFromState(); const isDark = tinyColor(theme.sidebarBg).isDark(); const componentId = NavigationStore.getVisibleScreen(); + if (!componentId) { + logError('Trying to go to screen without any screen on the navigation store'); + return ''; + } + const defaultOptions: Options = { layout: { componentBackgroundColor: theme.centerChannelBg, diff --git a/app/store/ephemeral_store.ts b/app/store/ephemeral_store.ts index bc2674f0bf..6015f0184d 100644 --- a/app/store/ephemeral_store.ts +++ b/app/store/ephemeral_store.ts @@ -38,6 +38,16 @@ class EphemeralStore { private notificationTapped = false; private enablingCRT = false; + // There are some corner cases where the react context is not loaded (and therefore + // launch will be called) but the notification callbacks are registered. This is used + // so the notification is processed only once (preferably on launch). + private processingNotification = ''; + + setProcessingNotification = (v: string) => { + this.processingNotification = v; + }; + getProcessingNotification = () => this.processingNotification; + addLoadingMessagesForChannel = (serverUrl: string, channelId: string) => { if (!this.loadingMessagesForChannel[serverUrl]) { this.loadingMessagesForChannel[serverUrl] = new Set(); diff --git a/app/store/navigation_store.ts b/app/store/navigation_store.ts index 2f19fce4e3..0c0f815cad 100644 --- a/app/store/navigation_store.ts +++ b/app/store/navigation_store.ts @@ -9,6 +9,13 @@ class NavigationStore { private visibleTab = 'Home'; private tosOpen = false; + reset = () => { + this.screensInStack = []; + this.modalsInStack = []; + this.visibleTab = 'Home'; + this.tosOpen = false; + }; + addModalToStack = (modalId: AvailableScreens) => { this.removeModalFromStack(modalId); this.addScreenToStack(modalId); diff --git a/index.ts b/index.ts index 430b7434ec..457eb096ee 100644 --- a/index.ts +++ b/index.ts @@ -8,7 +8,7 @@ import {RUNNING_E2E} from 'react-native-dotenv'; import 'react-native-gesture-handler'; import {Navigation} from 'react-native-navigation'; -import {initialize, start} from './app/init/app'; +import {start} from './app/init/app'; import setFontFamily from './app/utils/font_family'; import {logInfo} from './app/utils/log'; @@ -59,6 +59,5 @@ if (Platform.OS === 'android') { } Navigation.events().registerAppLaunchedListener(async () => { - await initialize(); start(); }); From e129b398220be3607b6e6c4216bc91fc19845e37 Mon Sep 17 00:00:00 2001 From: Mattermost Build Date: Wed, 5 Jul 2023 16:51:55 +0300 Subject: [PATCH 3/7] Bump version to 2.6.0 and build to 477 (#7436) (#7437) * Bump app version number to 2.6.0 * Bump app build number to 477 (cherry picked from commit d3e576ebed0a322d97be732ef8ed3cb006de0d09) Co-authored-by: Elias Nahum --- android/app/build.gradle | 4 +- ios/Mattermost.xcodeproj/project.pbxproj | 8 +- ios/Mattermost/Info.plist | 4 +- ios/MattermostShare/Info.plist | 4 +- ios/NotificationService/Info.plist | 4 +- package-lock.json | 143 +++++++++++++++-------- package.json | 2 +- 7 files changed, 108 insertions(+), 61 deletions(-) diff --git a/android/app/build.gradle b/android/app/build.gradle index 5503ee62f9..b8f7addf45 100644 --- a/android/app/build.gradle +++ b/android/app/build.gradle @@ -110,8 +110,8 @@ android { applicationId "com.mattermost.rnbeta" minSdkVersion rootProject.ext.minSdkVersion targetSdkVersion rootProject.ext.targetSdkVersion - versionCode 476 - versionName "2.5.1" + versionCode 477 + versionName "2.6.0" testBuildType System.getProperty('testBuildType', 'debug') testInstrumentationRunner 'androidx.test.runner.AndroidJUnitRunner' } diff --git a/ios/Mattermost.xcodeproj/project.pbxproj b/ios/Mattermost.xcodeproj/project.pbxproj index 098672f738..62042ecb63 100644 --- a/ios/Mattermost.xcodeproj/project.pbxproj +++ b/ios/Mattermost.xcodeproj/project.pbxproj @@ -1923,7 +1923,7 @@ CODE_SIGN_ENTITLEMENTS = Mattermost/Mattermost.entitlements; CODE_SIGN_IDENTITY = "iPhone Developer"; "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; - CURRENT_PROJECT_VERSION = 476; + CURRENT_PROJECT_VERSION = 477; DEVELOPMENT_TEAM = UQ8HT4Q2XM; ENABLE_BITCODE = NO; HEADER_SEARCH_PATHS = ( @@ -1967,7 +1967,7 @@ CODE_SIGN_ENTITLEMENTS = Mattermost/Mattermost.entitlements; CODE_SIGN_IDENTITY = "iPhone Developer"; "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; - CURRENT_PROJECT_VERSION = 476; + CURRENT_PROJECT_VERSION = 477; DEVELOPMENT_TEAM = UQ8HT4Q2XM; ENABLE_BITCODE = NO; HEADER_SEARCH_PATHS = ( @@ -2110,7 +2110,7 @@ CODE_SIGN_IDENTITY = "iPhone Developer"; "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; CODE_SIGN_STYLE = Automatic; - CURRENT_PROJECT_VERSION = 476; + CURRENT_PROJECT_VERSION = 477; DEBUG_INFORMATION_FORMAT = dwarf; DEVELOPMENT_TEAM = UQ8HT4Q2XM; GCC_C_LANGUAGE_STANDARD = gnu11; @@ -2159,7 +2159,7 @@ "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; CODE_SIGN_STYLE = Automatic; COPY_PHASE_STRIP = NO; - CURRENT_PROJECT_VERSION = 476; + CURRENT_PROJECT_VERSION = 477; DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; DEVELOPMENT_TEAM = UQ8HT4Q2XM; GCC_C_LANGUAGE_STANDARD = gnu11; diff --git a/ios/Mattermost/Info.plist b/ios/Mattermost/Info.plist index 38adab9ab9..559ef0c16e 100644 --- a/ios/Mattermost/Info.plist +++ b/ios/Mattermost/Info.plist @@ -21,7 +21,7 @@ CFBundlePackageType APPL CFBundleShortVersionString - 2.5.1 + 2.6.0 CFBundleSignature ???? CFBundleURLTypes @@ -37,7 +37,7 @@ CFBundleVersion - 476 + 477 ITSAppUsesNonExemptEncryption LSRequiresIPhoneOS diff --git a/ios/MattermostShare/Info.plist b/ios/MattermostShare/Info.plist index e42a39765d..9c22c72def 100644 --- a/ios/MattermostShare/Info.plist +++ b/ios/MattermostShare/Info.plist @@ -19,9 +19,9 @@ CFBundlePackageType XPC! CFBundleShortVersionString - 2.5.1 + 2.6.0 CFBundleVersion - 476 + 477 UIAppFonts OpenSans-Bold.ttf diff --git a/ios/NotificationService/Info.plist b/ios/NotificationService/Info.plist index 923652d8d3..34a3540203 100644 --- a/ios/NotificationService/Info.plist +++ b/ios/NotificationService/Info.plist @@ -19,9 +19,9 @@ CFBundlePackageType XPC! CFBundleShortVersionString - 2.5.1 + 2.6.0 CFBundleVersion - 476 + 477 NSExtension NSExtensionPointIdentifier diff --git a/package-lock.json b/package-lock.json index adc41076f5..0700b46960 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "mattermost-mobile", - "version": "2.5.1", + "version": "2.6.0", "lockfileVersion": 2, "requires": true, "packages": { @@ -22261,7 +22261,8 @@ "version": "7.21.0-placeholder-for-preset-env.2", "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-private-property-in-object/-/plugin-proposal-private-property-in-object-7.21.0-placeholder-for-preset-env.2.tgz", "integrity": "sha512-SOSkfJDddaM7mak6cPEpswyTRnuRltl429hMraQEglW+OkovnCzsiszTmsrlY//qLFjCpQDFRvjdm2wA5pPm9w==", - "requires": {} + "requires": { + } }, "@babel/plugin-proposal-unicode-property-regex": { "version": "7.18.6", @@ -24098,7 +24099,8 @@ "version": "1.3.5", "resolved": "https://registry.npmjs.org/@mattermost/react-native-emm/-/react-native-emm-1.3.5.tgz", "integrity": "sha512-REdUEsm/RA6lI1Rt4b009jvWn28f7H+e27gd4hlNk6zesIh/dlfiHwYfInW/vwbNFBdSPpvHy7Qi2mdcvrNqhg==", - "requires": {} + "requires": { + } }, "@mattermost/react-native-network-client": { "version": "1.3.4", @@ -24144,7 +24146,8 @@ "version": "0.2.3", "resolved": "https://registry.npmjs.org/@mattermost/react-native-turbo-log/-/react-native-turbo-log-0.2.3.tgz", "integrity": "sha512-usWyD8zVAHzrYqgPH1ne5I14gCOkhS2mefK58g5v4DewZfCm0/Uc0w8MRuPS/9jyOPPq1rUZj8U1AqKgEne9tQ==", - "requires": {} + "requires": { + } }, "@msgpack/msgpack": { "version": "2.8.0", @@ -24240,13 +24243,15 @@ "version": "5.6.0", "resolved": "https://registry.npmjs.org/@react-native-camera-roll/camera-roll/-/camera-roll-5.6.0.tgz", "integrity": "sha512-a/GYwnBTxj1yKWB9m/qy8GzjowSocML8NbLT81wdMh0JzZYXCLze51BR2cb8JNDgRPzA9xe7KpD3j9qQOSOjag==", - "requires": {} + "requires": { + } }, "@react-native-clipboard/clipboard": { "version": "1.11.2", "resolved": "https://registry.npmjs.org/@react-native-clipboard/clipboard/-/clipboard-1.11.2.tgz", "integrity": "sha512-bHyZVW62TuleiZsXNHS1Pv16fWc0fh8O9WvBzl4h2fykqZRW9a+Pv/RGTH56E3X2PqzHP38K5go8zmCZUoIsoQ==", - "requires": {} + "requires": { + } }, "@react-native-community/cli": { "version": "10.2.4", @@ -25403,7 +25408,8 @@ "version": "9.3.10", "resolved": "https://registry.npmjs.org/@react-native-community/netinfo/-/netinfo-9.3.10.tgz", "integrity": "sha512-OwnqoJUp/4sa9e3ju+wQavAa8l0fiA3DheeLMKzKxtKeAe0CA7bNxWRM752JvRQ6A/igPnt1V0zSlu5owvQEuA==", - "requires": {} + "requires": { + } }, "@react-native-cookies/cookies": { "version": "6.2.1", @@ -25479,7 +25485,8 @@ "version": "1.3.17", "resolved": "https://registry.npmjs.org/@react-navigation/elements/-/elements-1.3.17.tgz", "integrity": "sha512-sui8AzHm6TxeEvWT/NEXlz3egYvCUog4tlXA4Xlb2Vxvy3purVXDq/XsM56lJl344U5Aj/jDzkVanOTMWyk4UA==", - "requires": {} + "requires": { + } }, "@react-navigation/native": { "version": "6.1.6", @@ -25763,63 +25770,72 @@ "version": "0.10.3", "resolved": "https://registry.npmjs.org/@stream-io/flat-list-mvcp/-/flat-list-mvcp-0.10.3.tgz", "integrity": "sha512-2ZK8piYlEfKIPZrH8BpZz9uj8HZcUvMCV0X7qSLSAc/vhLOANBfR0SSn0OaWPbqb2mFGAd4FxmLSPp1zKEYuaw==", - "requires": {} + "requires": { + } }, "@svgr/babel-plugin-add-jsx-attribute": { "version": "6.0.0", "resolved": "https://registry.npmjs.org/@svgr/babel-plugin-add-jsx-attribute/-/babel-plugin-add-jsx-attribute-6.0.0.tgz", "integrity": "sha512-MdPdhdWLtQsjd29Wa4pABdhWbaRMACdM1h31BY+c6FghTZqNGT7pEYdBoaGeKtdTOBC/XNFQaKVj+r/Ei2ryWA==", "dev": true, - "requires": {} + "requires": { + } }, "@svgr/babel-plugin-remove-jsx-attribute": { "version": "6.0.0", "resolved": "https://registry.npmjs.org/@svgr/babel-plugin-remove-jsx-attribute/-/babel-plugin-remove-jsx-attribute-6.0.0.tgz", "integrity": "sha512-aVdtfx9jlaaxc3unA6l+M9YRnKIZjOhQPthLKqmTXC8UVkBLDRGwPKo+r8n3VZN8B34+yVajzPTZ+ptTSuZZCw==", "dev": true, - "requires": {} + "requires": { + } }, "@svgr/babel-plugin-remove-jsx-empty-expression": { "version": "6.0.0", "resolved": "https://registry.npmjs.org/@svgr/babel-plugin-remove-jsx-empty-expression/-/babel-plugin-remove-jsx-empty-expression-6.0.0.tgz", "integrity": "sha512-Ccj42ApsePD451AZJJf1QzTD1B/BOU392URJTeXFxSK709i0KUsGtbwyiqsKu7vsYxpTM0IA5clAKDyf9RCZyA==", "dev": true, - "requires": {} + "requires": { + } }, "@svgr/babel-plugin-replace-jsx-attribute-value": { "version": "6.0.0", "resolved": "https://registry.npmjs.org/@svgr/babel-plugin-replace-jsx-attribute-value/-/babel-plugin-replace-jsx-attribute-value-6.0.0.tgz", "integrity": "sha512-88V26WGyt1Sfd1emBYmBJRWMmgarrExpKNVmI9vVozha4kqs6FzQJ/Kp5+EYli1apgX44518/0+t9+NU36lThQ==", "dev": true, - "requires": {} + "requires": { + } }, "@svgr/babel-plugin-svg-dynamic-title": { "version": "6.0.0", "resolved": "https://registry.npmjs.org/@svgr/babel-plugin-svg-dynamic-title/-/babel-plugin-svg-dynamic-title-6.0.0.tgz", "integrity": "sha512-F7YXNLfGze+xv0KMQxrl2vkNbI9kzT9oDK55/kUuymh1ACyXkMV+VZWX1zEhSTfEKh7VkHVZGmVtHg8eTZ6PRg==", "dev": true, - "requires": {} + "requires": { + } }, "@svgr/babel-plugin-svg-em-dimensions": { "version": "6.0.0", "resolved": "https://registry.npmjs.org/@svgr/babel-plugin-svg-em-dimensions/-/babel-plugin-svg-em-dimensions-6.0.0.tgz", "integrity": "sha512-+rghFXxdIqJNLQK08kwPBD3Z22/0b2tEZ9lKiL/yTfuyj1wW8HUXu4bo/XkogATIYuXSghVQOOCwURXzHGKyZA==", "dev": true, - "requires": {} + "requires": { + } }, "@svgr/babel-plugin-transform-react-native-svg": { "version": "6.0.0", "resolved": "https://registry.npmjs.org/@svgr/babel-plugin-transform-react-native-svg/-/babel-plugin-transform-react-native-svg-6.0.0.tgz", "integrity": "sha512-VaphyHZ+xIKv5v0K0HCzyfAaLhPGJXSk2HkpYfXIOKb7DjLBv0soHDxNv6X0vr2titsxE7klb++u7iOf7TSrFQ==", "dev": true, - "requires": {} + "requires": { + } }, "@svgr/babel-plugin-transform-svg-component": { "version": "6.1.0", "resolved": "https://registry.npmjs.org/@svgr/babel-plugin-transform-svg-component/-/babel-plugin-transform-svg-component-6.1.0.tgz", "integrity": "sha512-1zacrn08K5RyV2NtXahOZ5Im/+aB1Y0LVh6QpzwgQV05sY7H5Npq+OcW/UqXbfB2Ua/WnHsFossFQqigCjarYg==", "dev": true, - "requires": {} + "requires": { + } }, "@svgr/babel-preset": { "version": "6.1.0", @@ -26602,7 +26618,8 @@ "resolved": "https://registry.npmjs.org/@webpack-cli/configtest/-/configtest-1.1.0.tgz", "integrity": "sha512-ttOkEkoalEHa7RaFYpM0ErK1xc4twg3Am9hfHhL7MVqlHebnkYd2wuI/ZqTDj0cVzZho6PdinY0phFZV3O0Mzg==", "dev": true, - "requires": {} + "requires": { + } }, "@webpack-cli/info": { "version": "1.4.0", @@ -26618,7 +26635,8 @@ "resolved": "https://registry.npmjs.org/@webpack-cli/serve/-/serve-1.6.0.tgz", "integrity": "sha512-ZkVeqEmRpBV2GHvjjUZqEai2PpUbuq8Bqd//vEYsp63J8WyexI8ppCqVS3Zs0QADf6aWuPdU+0XsPI647PVlQA==", "dev": true, - "requires": {} + "requires": { + } }, "@xtuc/ieee754": { "version": "1.2.0", @@ -26673,14 +26691,16 @@ "integrity": "sha512-m7VZ3jwz4eK6A4Vtt8Ew1/mNbP24u0FhdyfA7fSvnJR6LMdfOYnmuIrrJAgrYfYJ10F/otaHTtrtrtmHdMNzEw==", "dev": true, "peer": true, - "requires": {} + "requires": { + } }, "acorn-jsx": { "version": "5.3.2", "resolved": "https://registry.npmjs.org/acorn-jsx/-/acorn-jsx-5.3.2.tgz", "integrity": "sha512-rq9s+JNhf0IChjtDXxllJ7g41oZk5SlXtp0LHwyA5cejwn7vKmKp4pPri6YEePv2PU65sAsegbXtIinmDFDXgQ==", "dev": true, - "requires": {} + "requires": { + } }, "adm-zip": { "version": "0.5.9", @@ -26742,7 +26762,8 @@ "integrity": "sha512-5p6WTN0DdTGVQk6VjcEju19IgaHudalcfabD7yhDGeA6bcQnmL+CpveLJq/3hvfwd1aof6L386Ougkx6RfyMIQ==", "dev": true, "peer": true, - "requires": {} + "requires": { + } }, "anser": { "version": "1.4.10", @@ -26978,7 +26999,8 @@ "version": "7.0.0-bridge.0", "resolved": "https://registry.npmjs.org/babel-core/-/babel-core-7.0.0-bridge.0.tgz", "integrity": "sha512-poPX9mZH/5CSanm50Q+1toVci6pv5KSRv/5TWCwtzQS5XEwn40BcCrgIeMFWP9CKKIniKXNxoIOnOq4VVlGXhg==", - "requires": {} + "requires": { + } }, "babel-jest": { "version": "29.5.0", @@ -29002,7 +29024,8 @@ "resolved": "https://registry.npmjs.org/eslint-config-prettier/-/eslint-config-prettier-8.5.0.tgz", "integrity": "sha512-obmWKLUNCnhtQRKc+tmnYuQl0pFU1ibYJQ5BGhTVB08bHe9wC8qUeG7c08dj9XX+AuPj1YSGSQIHl1pnDHZR0Q==", "dev": true, - "requires": {} + "requires": { + } }, "eslint-import-resolver-node": { "version": "0.3.7", @@ -29090,7 +29113,8 @@ "resolved": "https://registry.npmjs.org/eslint-plugin-header/-/eslint-plugin-header-3.1.1.tgz", "integrity": "sha512-9vlKxuJ4qf793CmeeSrZUvVClw6amtpghq3CuWcB5cUNnWHQhgcqy5eF8oVKFk1G3Y/CbchGfEaw3wiIJaNmVg==", "dev": true, - "requires": {} + "requires": { + } }, "eslint-plugin-import": { "version": "2.27.5", @@ -29226,7 +29250,8 @@ "resolved": "https://registry.npmjs.org/eslint-plugin-react-hooks/-/eslint-plugin-react-hooks-4.6.0.tgz", "integrity": "sha512-oFc7Itz9Qxh2x4gNHStv3BqJq54ExXmfC+a1NjAta66IAN87Wu0R/QArgIS9qKzX3dXKPI9H5crl9QchNMY9+g==", "dev": true, - "requires": {} + "requires": { + } }, "eslint-plugin-react-native": { "version": "4.0.0", @@ -31601,7 +31626,8 @@ "resolved": "https://registry.npmjs.org/jest-pnp-resolver/-/jest-pnp-resolver-1.2.3.tgz", "integrity": "sha512-+3NpwQEnRoIBtx4fyhblQDPgJI0H1IEIkX7ShLUjPGA7TtUTvI1oiKi3SR4oBR0hQhQR80l4WAe5RrXBwWMA8w==", "dev": true, - "requires": {} + "requires": { + } }, "jest-regex-util": { "version": "29.4.3", @@ -34981,7 +35007,8 @@ "version": "1.0.3", "resolved": "https://registry.npmjs.org/react-freeze/-/react-freeze-1.0.3.tgz", "integrity": "sha512-ZnXwLQnGzrDpHBHiC56TXFXvmolPeMjTn1UOm610M4EXGzbEDR7oOIyS2ZiItgbs6eZc4oU/a0hpk8PrcKvv5g==", - "requires": {} + "requires": { + } }, "react-intl": { "version": "6.4.4", @@ -35159,7 +35186,8 @@ "version": "2.4.1", "resolved": "https://registry.npmjs.org/react-native-background-timer/-/react-native-background-timer-2.4.1.tgz", "integrity": "sha512-TE4Kiy7jUyv+hugxDxitzu38sW1NqjCk4uE5IgU2WevLv7sZacaBc6PZKOShNRPGirLl1NWkaG3LDEkdb9Um5g==", - "requires": {} + "requires": { + } }, "react-native-button": { "version": "3.1.0", @@ -35212,13 +35240,15 @@ "version": "1.6.4", "resolved": "https://registry.npmjs.org/react-native-create-thumbnail/-/react-native-create-thumbnail-1.6.4.tgz", "integrity": "sha512-JWuKXswDXtqUPfuqh6rjCVMvTSSG3kUtwvSK/YdaNU0i+nZKxeqHmt/CO2+TyI/WSUFynGVmWT1xOHhCZAFsRQ==", - "requires": {} + "requires": { + } }, "react-native-device-info": { "version": "10.6.0", "resolved": "https://registry.npmjs.org/react-native-device-info/-/react-native-device-info-10.6.0.tgz", "integrity": "sha512-/MmINdojWdw2/9rwYpH/dX+1gFP0o78p8yYPjwxiPhoySSL2rZaNi+Mq9VwC+zFi/yQmJUvHntkKSw2KUc7rFw==", - "requires": {} + "requires": { + } }, "react-native-document-picker": { "version": "9.0.1", @@ -35255,19 +35285,22 @@ "version": "2.10.10", "resolved": "https://registry.npmjs.org/react-native-exception-handler/-/react-native-exception-handler-2.10.10.tgz", "integrity": "sha512-otAXGoZDl1689OoUJWN/rXxVbdoZ3xcmyF1uq/CsizdLwwyZqVGd6d+p/vbYvnF996FfEyAEBnHrdFxulTn51w==", - "requires": {} + "requires": { + } }, "react-native-fast-image": { "version": "8.6.3", "resolved": "https://registry.npmjs.org/react-native-fast-image/-/react-native-fast-image-8.6.3.tgz", "integrity": "sha512-Sdw4ESidXCXOmQ9EcYguNY2swyoWmx53kym2zRsvi+VeFCHEdkO+WG1DK+6W81juot40bbfLNhkc63QnWtesNg==", - "requires": {} + "requires": { + } }, "react-native-file-viewer": { "version": "2.1.5", "resolved": "https://registry.npmjs.org/react-native-file-viewer/-/react-native-file-viewer-2.1.5.tgz", "integrity": "sha512-MGC6sx9jsqHdefhVQ6o0akdsPGpkXgiIbpygb2Sg4g4bh7v6K1cardLV1NwGB9A6u1yICOSDT/MOC//9Ez6EUg==", - "requires": {} + "requires": { + } }, "react-native-fs": { "version": "2.20.0", @@ -35306,19 +35339,22 @@ "version": "2.0.3", "resolved": "https://registry.npmjs.org/react-native-haptic-feedback/-/react-native-haptic-feedback-2.0.3.tgz", "integrity": "sha512-7+qvcxXZts/hA+HOOIFyM1x9m9fn/TJVSTgXaoQ8uT4gLc97IMvqHQ559tDmnlth+hHMzd3HRMpmRLWoKPL0DA==", - "requires": {} + "requires": { + } }, "react-native-hw-keyboard-event": { "version": "0.0.4", "resolved": "https://registry.npmjs.org/react-native-hw-keyboard-event/-/react-native-hw-keyboard-event-0.0.4.tgz", "integrity": "sha512-G8qp0nm17PHigLb/axgdF9xg51BKCG2p1AGeq//J/luLp5zNczIcQJh+nm02R1MeEUE3e53wqO4LMe0MV3raZg==", - "requires": {} + "requires": { + } }, "react-native-image-picker": { "version": "5.4.2", "resolved": "https://registry.npmjs.org/react-native-image-picker/-/react-native-image-picker-5.4.2.tgz", "integrity": "sha512-C/k3cYAh8fBImoGEwmiChNwHx9fJGqAIu2E4BUJdI1XlL17tSYjfTDx/bsuF4amZwa7hxZdQnZmpk0EnwIEUaw==", - "requires": {} + "requires": { + } }, "react-native-in-app-review": { "version": "4.3.3", @@ -35328,13 +35364,15 @@ "react-native-incall-manager": { "version": "git+ssh://git@github.com/react-native-webrtc/react-native-incall-manager.git#6d927ef24c6e47c6134177a4bb14a71054f85b65", "from": "react-native-incall-manager@4.0.1", - "requires": {} + "requires": { + } }, "react-native-iphone-x-helper": { "version": "1.3.1", "resolved": "https://registry.npmjs.org/react-native-iphone-x-helper/-/react-native-iphone-x-helper-1.3.1.tgz", "integrity": "sha512-HOf0jzRnq2/aFUcdCJ9w9JGzN3gdEg0zFE4FyYlp4jtidqU03D5X7ZegGKfT1EWteR0gPBGp9ye5T5FvSWi9Yg==", - "requires": {} + "requires": { + } }, "react-native-keyboard-aware-scroll-view": { "version": "0.9.5", @@ -35349,7 +35387,8 @@ "version": "5.7.0", "resolved": "https://registry.npmjs.org/react-native-keyboard-tracking-view/-/react-native-keyboard-tracking-view-5.7.0.tgz", "integrity": "sha512-MDeEwAbn9LJDOfHq0QLCGaZirVLk2X/tHqkAqz3y6uxryTRdSl9PwleOVar5Jx2oAPEg4J9BXbUD1wwOOi+5Kg==", - "requires": {} + "requires": { + } }, "react-native-keychain": { "version": "8.1.1", @@ -35360,13 +35399,15 @@ "version": "2.7.2", "resolved": "https://registry.npmjs.org/react-native-linear-gradient/-/react-native-linear-gradient-2.7.2.tgz", "integrity": "sha512-c1mNtmQrD+nzlIePQ5XZR/6IuEaNcYvE+N7MnOHDSOkXmxfLVbyicT15KEYnXQqbTLwTrFNJPZot241lWRVC3g==", - "requires": {} + "requires": { + } }, "react-native-localize": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/react-native-localize/-/react-native-localize-3.0.0.tgz", "integrity": "sha512-B8taYRLuLIYDzBTKIglA3K6ntjaEwbk6mwQ72ogZYl5ovM00NnpbiZ3sRq8KRVe/V1NGczxT33uVqG6BUWGWhg==", - "requires": {} + "requires": { + } }, "react-native-math-view": { "version": "3.9.5", @@ -35402,7 +35443,8 @@ "version": "4.3.5", "resolved": "https://registry.npmjs.org/react-native-notifications/-/react-native-notifications-4.3.5.tgz", "integrity": "sha512-tCKkPaauN8/RIwPTeWdyezHXt5i4iDJViZGZ7/EBBuHB9kl9Oq3UjKFZeDfnM4DmJt+m7K2FQ7NaAuh3Kg1FCA==", - "requires": {} + "requires": { + } }, "react-native-permissions": { "version": "3.8.0", @@ -35443,7 +35485,8 @@ "version": "4.5.3", "resolved": "https://registry.npmjs.org/react-native-safe-area-context/-/react-native-safe-area-context-4.5.3.tgz", "integrity": "sha512-ihYeGDEBSkYH+1aWnadNhVtclhppVgd/c0tm4mj0+HV11FoiWJ8N6ocnnZnRLvM5Fxc+hUqxR9bm5AXU3rXiyA==", - "requires": {} + "requires": { + } }, "react-native-screens": { "version": "3.21.0", @@ -35476,7 +35519,8 @@ "version": "0.3.1", "resolved": "https://registry.npmjs.org/react-native-size-matters/-/react-native-size-matters-0.3.1.tgz", "integrity": "sha512-mKOfBLIBFBcs9br1rlZDvxD5+mAl8Gfr5CounwJtxI6Z82rGrMO+Kgl9EIg3RMVf3G855a85YVqHJL2f5EDRlw==", - "requires": {} + "requires": { + } }, "react-native-svg": { "version": "13.9.0", @@ -37424,13 +37468,15 @@ "version": "0.1.6", "resolved": "https://registry.npmjs.org/use-latest-callback/-/use-latest-callback-0.1.6.tgz", "integrity": "sha512-VO/P91A/PmKH9bcN9a7O3duSuxe6M14ZoYXgA6a8dab8doWNdhiIHzEkX/jFeTTRBsX0Ubk6nG4q2NIjNsj+bg==", - "requires": {} + "requires": { + } }, "use-sync-external-store": { "version": "1.2.0", "resolved": "https://registry.npmjs.org/use-sync-external-store/-/use-sync-external-store-1.2.0.tgz", "integrity": "sha512-eEgnFxGQ1Ife9bzYs6VLi8/4X6CObHMw9Qr9tPY43iKwsPw8xE8+EFsf/2cFZ5S3esXgpWgtSCtLNS41F+sKPA==", - "requires": {} + "requires": { + } }, "utf8": { "version": "3.0.0", @@ -37751,7 +37797,8 @@ "version": "7.5.5", "resolved": "https://registry.npmjs.org/ws/-/ws-7.5.5.tgz", "integrity": "sha512-BAkMFcAzl8as1G/hArkxOxq3G7pjUqQ3gzYbLL0/5zNkph70e+lCoxBGnm6AW1+/aiNeV4fnKqZ8m4GZewmH2w==", - "requires": {} + "requires": { + } }, "xdate": { "version": "0.8.2", diff --git a/package.json b/package.json index 75efde17b4..c7025dc8fd 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "mattermost-mobile", - "version": "2.5.1", + "version": "2.6.0", "description": "Mattermost Mobile with React Native", "repository": "git@github.com:mattermost/mattermost-mobile.git", "author": "Mattermost, Inc.", From 4fc9138cee2d432df328681c84372125b5385889 Mon Sep 17 00:00:00 2001 From: Mattermost Build Date: Fri, 7 Jul 2023 12:21:23 +0300 Subject: [PATCH 4/7] Fix ios cache (#7412) (#7439) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Fix Keychain cache * Fix * Fix import (cherry picked from commit 5ab2f86b6636e6aa6d98337735582877d5f91094) Co-authored-by: Daniel Espino García --- .../java/com/mattermost/rnbeta/MattermostManagedModule.java | 5 +++++ app/managers/session_manager.ts | 2 ++ app/utils/mattermost_managed.ts | 4 ++++ ios/Gekidou/Sources/Gekidou/Keychain.swift | 4 ++++ ios/GekidouWrapper.swift | 4 ++++ ios/Mattermost/MattermostManaged.m | 4 ++++ 6 files changed, 23 insertions(+) diff --git a/android/app/src/main/java/com/mattermost/rnbeta/MattermostManagedModule.java b/android/app/src/main/java/com/mattermost/rnbeta/MattermostManagedModule.java index 765fc2fe88..368cfe2a80 100644 --- a/android/app/src/main/java/com/mattermost/rnbeta/MattermostManagedModule.java +++ b/android/app/src/main/java/com/mattermost/rnbeta/MattermostManagedModule.java @@ -221,6 +221,11 @@ public class MattermostManagedModule extends ReactContextBaseJavaModule { } } + @ReactMethod + public void invalidateKeychainCache(String serverUrl) { + // Not using cache + } + private static class SaveDataTask extends GuardedResultAsyncTask { private final WeakReference weakContext; private final String fromFile; diff --git a/app/managers/session_manager.ts b/app/managers/session_manager.ts index 0e21ca4a40..e039e5627e 100644 --- a/app/managers/session_manager.ts +++ b/app/managers/session_manager.ts @@ -22,6 +22,7 @@ import {getThemeFromState} from '@screens/navigation'; import EphemeralStore from '@store/ephemeral_store'; import {deleteFileCache, deleteFileCacheByDir} from '@utils/file'; import {isMainActivity} from '@utils/helpers'; +import {invalidateKeychainCache} from '@utils/mattermost_managed'; import {addNewServer} from '@utils/server'; import type {LaunchType} from '@typings/launch'; @@ -115,6 +116,7 @@ class SessionManager { private terminateSession = async (serverUrl: string, removeServer: boolean) => { cancelSessionNotification(serverUrl); await removeServerCredentials(serverUrl); + invalidateKeychainCache(serverUrl); PushNotifications.removeServerNotifications(serverUrl); NetworkManager.invalidateClient(serverUrl); diff --git a/app/utils/mattermost_managed.ts b/app/utils/mattermost_managed.ts index 04f3af1e81..f85207a111 100644 --- a/app/utils/mattermost_managed.ts +++ b/app/utils/mattermost_managed.ts @@ -64,3 +64,7 @@ export const deleteEntititesFile = (callback?: (success: boolean) => void) => { callback(true); } }; + +export const invalidateKeychainCache = (serverUrl: string) => { + MattermostManaged.invalidateKeychainCache(serverUrl); +}; diff --git a/ios/Gekidou/Sources/Gekidou/Keychain.swift b/ios/Gekidou/Sources/Gekidou/Keychain.swift index a31f7aeb95..b1bbf00361 100644 --- a/ios/Gekidou/Sources/Gekidou/Keychain.swift +++ b/ios/Gekidou/Sources/Gekidou/Keychain.swift @@ -100,6 +100,10 @@ public class Keychain: NSObject { return nil } + + public func invalidateToken(for serverUrl: String) { + tokenCache.removeValue(forKey: serverUrl) + } private func buildIdentityQuery(for host: String) throws -> [CFString: Any] { guard let hostData = host.data(using: .utf8) else { diff --git a/ios/GekidouWrapper.swift b/ios/GekidouWrapper.swift index 8a82055a62..e1386515ff 100644 --- a/ios/GekidouWrapper.swift +++ b/ios/GekidouWrapper.swift @@ -42,4 +42,8 @@ import Gekidou return nil } + + @objc func invalidateToken(for url: String) { + Keychain.default.invalidateToken(for: url) + } } diff --git a/ios/Mattermost/MattermostManaged.m b/ios/Mattermost/MattermostManaged.m index 89bb75381a..2bea2d0697 100644 --- a/ios/Mattermost/MattermostManaged.m +++ b/ios/Mattermost/MattermostManaged.m @@ -153,6 +153,10 @@ RCT_EXPORT_METHOD(removeListeners:(double)count) { // Keep: Required for RN built in Event Emitter Calls. } +RCT_EXPORT_METHOD(invalidateKeychainCache:(NSString *) serverUrl) +{ + [[GekidouWrapper default] invalidateTokenFor:serverUrl]; +} RCT_EXPORT_METHOD(createThumbnail:(NSDictionary *)config findEventsWithResolver:(RCTPromiseResolveBlock)resolve rejecter:(RCTPromiseRejectBlock)reject) { From 5eea5aec869a3e4bd02cae52972f3071c801fd6b Mon Sep 17 00:00:00 2001 From: Mattermost Build Date: Fri, 7 Jul 2023 16:47:00 +0300 Subject: [PATCH 5/7] Bump app build number to 478 (#7441) (#7442) (cherry picked from commit 0d4d6e22ca88bd187f8be59597909c32bf061f35) Co-authored-by: Elias Nahum --- android/app/build.gradle | 2 +- ios/Mattermost.xcodeproj/project.pbxproj | 8 ++++---- ios/Mattermost/Info.plist | 2 +- ios/MattermostShare/Info.plist | 2 +- ios/NotificationService/Info.plist | 2 +- 5 files changed, 8 insertions(+), 8 deletions(-) diff --git a/android/app/build.gradle b/android/app/build.gradle index b8f7addf45..5ac4327a12 100644 --- a/android/app/build.gradle +++ b/android/app/build.gradle @@ -110,7 +110,7 @@ android { applicationId "com.mattermost.rnbeta" minSdkVersion rootProject.ext.minSdkVersion targetSdkVersion rootProject.ext.targetSdkVersion - versionCode 477 + versionCode 478 versionName "2.6.0" testBuildType System.getProperty('testBuildType', 'debug') testInstrumentationRunner 'androidx.test.runner.AndroidJUnitRunner' diff --git a/ios/Mattermost.xcodeproj/project.pbxproj b/ios/Mattermost.xcodeproj/project.pbxproj index 62042ecb63..4692e23244 100644 --- a/ios/Mattermost.xcodeproj/project.pbxproj +++ b/ios/Mattermost.xcodeproj/project.pbxproj @@ -1923,7 +1923,7 @@ CODE_SIGN_ENTITLEMENTS = Mattermost/Mattermost.entitlements; CODE_SIGN_IDENTITY = "iPhone Developer"; "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; - CURRENT_PROJECT_VERSION = 477; + CURRENT_PROJECT_VERSION = 478; DEVELOPMENT_TEAM = UQ8HT4Q2XM; ENABLE_BITCODE = NO; HEADER_SEARCH_PATHS = ( @@ -1967,7 +1967,7 @@ CODE_SIGN_ENTITLEMENTS = Mattermost/Mattermost.entitlements; CODE_SIGN_IDENTITY = "iPhone Developer"; "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; - CURRENT_PROJECT_VERSION = 477; + CURRENT_PROJECT_VERSION = 478; DEVELOPMENT_TEAM = UQ8HT4Q2XM; ENABLE_BITCODE = NO; HEADER_SEARCH_PATHS = ( @@ -2110,7 +2110,7 @@ CODE_SIGN_IDENTITY = "iPhone Developer"; "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; CODE_SIGN_STYLE = Automatic; - CURRENT_PROJECT_VERSION = 477; + CURRENT_PROJECT_VERSION = 478; DEBUG_INFORMATION_FORMAT = dwarf; DEVELOPMENT_TEAM = UQ8HT4Q2XM; GCC_C_LANGUAGE_STANDARD = gnu11; @@ -2159,7 +2159,7 @@ "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; CODE_SIGN_STYLE = Automatic; COPY_PHASE_STRIP = NO; - CURRENT_PROJECT_VERSION = 477; + CURRENT_PROJECT_VERSION = 478; DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; DEVELOPMENT_TEAM = UQ8HT4Q2XM; GCC_C_LANGUAGE_STANDARD = gnu11; diff --git a/ios/Mattermost/Info.plist b/ios/Mattermost/Info.plist index 559ef0c16e..b3bb98fafd 100644 --- a/ios/Mattermost/Info.plist +++ b/ios/Mattermost/Info.plist @@ -37,7 +37,7 @@ CFBundleVersion - 477 + 478 ITSAppUsesNonExemptEncryption LSRequiresIPhoneOS diff --git a/ios/MattermostShare/Info.plist b/ios/MattermostShare/Info.plist index 9c22c72def..121b55e77a 100644 --- a/ios/MattermostShare/Info.plist +++ b/ios/MattermostShare/Info.plist @@ -21,7 +21,7 @@ CFBundleShortVersionString 2.6.0 CFBundleVersion - 477 + 478 UIAppFonts OpenSans-Bold.ttf diff --git a/ios/NotificationService/Info.plist b/ios/NotificationService/Info.plist index 34a3540203..a2a0bb401f 100644 --- a/ios/NotificationService/Info.plist +++ b/ios/NotificationService/Info.plist @@ -21,7 +21,7 @@ CFBundleShortVersionString 2.6.0 CFBundleVersion - 477 + 478 NSExtension NSExtensionPointIdentifier From 6b686ab3f81691831a11d6a56629bfac4dc4e767 Mon Sep 17 00:00:00 2001 From: Mattermost Build Date: Wed, 12 Jul 2023 17:31:29 +0300 Subject: [PATCH 6/7] fix: crash when reactor is missing (#7448) (#7449) (cherry picked from commit 40254fba96acf6fd835fa3002aa4d2a9295166f5) Co-authored-by: Elias Nahum --- app/components/user_item/user_item.tsx | 21 +++++++++++-------- .../reactors_list/reactor/reactor.tsx | 17 ++++++++++++--- app/utils/user/index.ts | 4 ++++ 3 files changed, 30 insertions(+), 12 deletions(-) diff --git a/app/components/user_item/user_item.tsx b/app/components/user_item/user_item.tsx index 6af46a5cac..84325d96ba 100644 --- a/app/components/user_item/user_item.tsx +++ b/app/components/user_item/user_item.tsx @@ -13,13 +13,13 @@ import {useTheme} from '@context/theme'; import {nonBreakingString} from '@utils/strings'; import {makeStyleSheetFromTheme, changeOpacity} from '@utils/theme'; import {typography} from '@utils/typography'; -import {displayUsername, getUserCustomStatus, isBot, isCustomStatusExpired, isGuest, isShared} from '@utils/user'; +import {displayUsername, getUserCustomStatus, isBot, isCustomStatusExpired, isDeactivated, isGuest, isShared} from '@utils/user'; import type UserModel from '@typings/database/models/servers/user'; type AtMentionItemProps = { FooterComponent?: ReactNode; - user: UserProfile | UserModel; + user?: UserProfile | UserModel; containerStyle?: StyleProp; currentUserId: string; includeMargin?: boolean; @@ -115,13 +115,12 @@ const UserItem = ({ const bot = user ? isBot(user) : false; const guest = user ? isGuest(user.roles) : false; const shared = user ? isShared(user) : false; + const deactivated = user ? isDeactivated(user) : false; const isCurrentUser = currentUserId === user?.id; const customStatus = getUserCustomStatus(user); const customStatusExpired = isCustomStatusExpired(user); - const deleteAt = 'deleteAt' in user ? user.deleteAt : user.delete_at; - let displayName = displayUsername(user, locale, teammateNameDisplay); const showTeammateDisplay = displayName !== user?.username; if (isCurrentUser) { @@ -142,11 +141,15 @@ const UserItem = ({ }, [disabled, padding, includeMargin]); const onPress = useCallback(() => { - onUserPress?.(user); + if (user) { + onUserPress?.(user); + } }, [user, onUserPress]); const onLongPress = useCallback(() => { - onUserLongPress?.(user); + if (user) { + onUserLongPress?.(user); + } }, [user, onUserLongPress]); return ( @@ -175,15 +178,15 @@ const UserItem = ({ testID={`${userItemTestId}.display_name`} > {nonBreakingString(displayName)} - {Boolean(showTeammateDisplay) && ( + {Boolean(showTeammateDisplay) && Boolean(user?.username) && ( - {nonBreakingString(` @${user!.username}`)} + {nonBreakingString(` @${user?.username}`)} )} - {Boolean(deleteAt) && ( + {deactivated && ( { +const Reactor = ({channelId, location, reaction, user}: Props) => { const intl = useIntl(); const theme = useTheme(); + const serverUrl = useServerUrl(); const openUserProfile = async () => { if (user) { await dismissBottomSheet(Screens.REACTIONS); @@ -34,6 +39,12 @@ const Reactor = ({channelId, location, user}: Props) => { } }; + useEffect(() => { + if (!user) { + fetchUsersByIds(serverUrl, [reaction.userId]); + } + }, []); + return ( = 0; i--) { From 02a702efe9bc0442021348cbc972e8dcefe39dd1 Mon Sep 17 00:00:00 2001 From: Mattermost Build Date: Wed, 12 Jul 2023 18:37:15 +0300 Subject: [PATCH 7/7] Bump app build number to 479 (#7451) (#7452) (cherry picked from commit bdcca34abf4dde1be08fe6d9f89428868f7d04b0) Co-authored-by: Elias Nahum --- android/app/build.gradle | 2 +- ios/Mattermost.xcodeproj/project.pbxproj | 8 ++++---- ios/Mattermost/Info.plist | 2 +- ios/MattermostShare/Info.plist | 2 +- ios/NotificationService/Info.plist | 2 +- 5 files changed, 8 insertions(+), 8 deletions(-) diff --git a/android/app/build.gradle b/android/app/build.gradle index 5ac4327a12..118bfd76e4 100644 --- a/android/app/build.gradle +++ b/android/app/build.gradle @@ -110,7 +110,7 @@ android { applicationId "com.mattermost.rnbeta" minSdkVersion rootProject.ext.minSdkVersion targetSdkVersion rootProject.ext.targetSdkVersion - versionCode 478 + versionCode 479 versionName "2.6.0" testBuildType System.getProperty('testBuildType', 'debug') testInstrumentationRunner 'androidx.test.runner.AndroidJUnitRunner' diff --git a/ios/Mattermost.xcodeproj/project.pbxproj b/ios/Mattermost.xcodeproj/project.pbxproj index 4692e23244..43c70780d8 100644 --- a/ios/Mattermost.xcodeproj/project.pbxproj +++ b/ios/Mattermost.xcodeproj/project.pbxproj @@ -1923,7 +1923,7 @@ CODE_SIGN_ENTITLEMENTS = Mattermost/Mattermost.entitlements; CODE_SIGN_IDENTITY = "iPhone Developer"; "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; - CURRENT_PROJECT_VERSION = 478; + CURRENT_PROJECT_VERSION = 479; DEVELOPMENT_TEAM = UQ8HT4Q2XM; ENABLE_BITCODE = NO; HEADER_SEARCH_PATHS = ( @@ -1967,7 +1967,7 @@ CODE_SIGN_ENTITLEMENTS = Mattermost/Mattermost.entitlements; CODE_SIGN_IDENTITY = "iPhone Developer"; "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; - CURRENT_PROJECT_VERSION = 478; + CURRENT_PROJECT_VERSION = 479; DEVELOPMENT_TEAM = UQ8HT4Q2XM; ENABLE_BITCODE = NO; HEADER_SEARCH_PATHS = ( @@ -2110,7 +2110,7 @@ CODE_SIGN_IDENTITY = "iPhone Developer"; "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; CODE_SIGN_STYLE = Automatic; - CURRENT_PROJECT_VERSION = 478; + CURRENT_PROJECT_VERSION = 479; DEBUG_INFORMATION_FORMAT = dwarf; DEVELOPMENT_TEAM = UQ8HT4Q2XM; GCC_C_LANGUAGE_STANDARD = gnu11; @@ -2159,7 +2159,7 @@ "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; CODE_SIGN_STYLE = Automatic; COPY_PHASE_STRIP = NO; - CURRENT_PROJECT_VERSION = 478; + CURRENT_PROJECT_VERSION = 479; DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; DEVELOPMENT_TEAM = UQ8HT4Q2XM; GCC_C_LANGUAGE_STANDARD = gnu11; diff --git a/ios/Mattermost/Info.plist b/ios/Mattermost/Info.plist index b3bb98fafd..2ef0a6bfa6 100644 --- a/ios/Mattermost/Info.plist +++ b/ios/Mattermost/Info.plist @@ -37,7 +37,7 @@ CFBundleVersion - 478 + 479 ITSAppUsesNonExemptEncryption LSRequiresIPhoneOS diff --git a/ios/MattermostShare/Info.plist b/ios/MattermostShare/Info.plist index 121b55e77a..968ea43c74 100644 --- a/ios/MattermostShare/Info.plist +++ b/ios/MattermostShare/Info.plist @@ -21,7 +21,7 @@ CFBundleShortVersionString 2.6.0 CFBundleVersion - 478 + 479 UIAppFonts OpenSans-Bold.ttf diff --git a/ios/NotificationService/Info.plist b/ios/NotificationService/Info.plist index a2a0bb401f..13793a1c07 100644 --- a/ios/NotificationService/Info.plist +++ b/ios/NotificationService/Info.plist @@ -21,7 +21,7 @@ CFBundleShortVersionString 2.6.0 CFBundleVersion - 478 + 479 NSExtension NSExtensionPointIdentifier