From 5386e58beb58ab8b774e5e27c98b07263a7edc49 Mon Sep 17 00:00:00 2001 From: Elias Nahum Date: Thu, 10 Aug 2023 11:18:13 -0400 Subject: [PATCH 01/94] Bump app build number to 481 (#7496) --- 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 8b9cf38f9..2157a9fe5 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 480 + versionCode 481 versionName "2.7.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 1292894b0..3b8b54b57 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 = 480; + CURRENT_PROJECT_VERSION = 481; 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 = 480; + CURRENT_PROJECT_VERSION = 481; 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 = 480; + CURRENT_PROJECT_VERSION = 481; 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 = 480; + CURRENT_PROJECT_VERSION = 481; 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 61eba4c7c..6da327de8 100644 --- a/ios/Mattermost/Info.plist +++ b/ios/Mattermost/Info.plist @@ -37,7 +37,7 @@ CFBundleVersion - 480 + 481 ITSAppUsesNonExemptEncryption LSRequiresIPhoneOS diff --git a/ios/MattermostShare/Info.plist b/ios/MattermostShare/Info.plist index 2a7719d4a..55f3f146e 100644 --- a/ios/MattermostShare/Info.plist +++ b/ios/MattermostShare/Info.plist @@ -21,7 +21,7 @@ CFBundleShortVersionString 2.7.0 CFBundleVersion - 480 + 481 UIAppFonts OpenSans-Bold.ttf diff --git a/ios/NotificationService/Info.plist b/ios/NotificationService/Info.plist index 930677877..eba59970c 100644 --- a/ios/NotificationService/Info.plist +++ b/ios/NotificationService/Info.plist @@ -21,7 +21,7 @@ CFBundleShortVersionString 2.7.0 CFBundleVersion - 480 + 481 NSExtension NSExtensionPointIdentifier From 4670a01ae73db4414fca1fd28048b4c647ca9d76 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Espino=20Garc=C3=ADa?= Date: Mon, 14 Aug 2023 10:01:55 +0200 Subject: [PATCH 02/94] Handle Mark Multiple Channels as Read (#7467) * Handle Mark Multiple Channels as Read * Use allSettled --- app/actions/websocket/channel.ts | 38 ++++++++++++++++++++++++++++++++ app/actions/websocket/index.ts | 5 +++++ app/constants/websocket.ts | 1 + 3 files changed, 44 insertions(+) diff --git a/app/actions/websocket/channel.ts b/app/actions/websocket/channel.ts index aa10a0fa5..088920cbc 100644 --- a/app/actions/websocket/channel.ts +++ b/app/actions/websocket/channel.ts @@ -18,6 +18,7 @@ import {deleteChannelMembership, getChannelById, prepareMyChannelsForTeam, getCu import {getConfig, getCurrentChannelId} from '@queries/servers/system'; import {getCurrentUser, getTeammateNameDisplay, getUserById} from '@queries/servers/user'; import EphemeralStore from '@store/ephemeral_store'; +import MyChannelModel from '@typings/database/models/servers/my_channel'; import {logDebug} from '@utils/log'; import type {Model} from '@nozbe/watermelondb'; @@ -122,6 +123,43 @@ export async function handleChannelViewedEvent(serverUrl: string, msg: any) { } } +export async function handleMultipleChannelsViewedEvent(serverUrl: string, msg: any) { + try { + const {database, operator} = DatabaseManager.getServerDatabaseAndOperator(serverUrl); + + const {channel_times: channelTimes} = msg.data; + + const activeServerUrl = await DatabaseManager.getActiveServerUrl(); + const currentChannelId = await getCurrentChannelId(database); + + const promises: Array> = []; + for (const id of Object.keys(channelTimes)) { + if (activeServerUrl === serverUrl && (currentChannelId === id || EphemeralStore.isSwitchingToChannel(id))) { + continue; + } + promises.push(markChannelAsViewed(serverUrl, id, false, true)); + } + + const members = (await Promise.allSettled(promises)).reduce((acum, v) => { + if (v.status === 'rejected') { + return acum; + } + + const value = v.value; + if (value.member) { + acum.push(value.member); + } + return acum; + }, []); + + if (members.length) { + operator.batchRecords(members, 'handleMultipleCahnnelViewedEvent'); + } + } catch { + // do nothing + } +} + // This event is triggered by changes in the notify props or in the roles. export async function handleChannelMemberUpdatedEvent(serverUrl: string, msg: any) { try { diff --git a/app/actions/websocket/index.ts b/app/actions/websocket/index.ts index d05243b9e..a2862aa3a 100644 --- a/app/actions/websocket/index.ts +++ b/app/actions/websocket/index.ts @@ -58,6 +58,7 @@ import {handleChannelConvertedEvent, handleChannelCreatedEvent, handleChannelUnarchiveEvent, handleChannelUpdatedEvent, handleChannelViewedEvent, + handleMultipleChannelsViewedEvent, handleDirectAddedEvent, handleUserAddedToChannelEvent, handleUserRemovedFromChannelEvent} from './channel'; @@ -254,6 +255,10 @@ export async function handleEvent(serverUrl: string, msg: WebSocketMessage) { handleChannelViewedEvent(serverUrl, msg); break; + case WebsocketEvents.MULTIPLE_CHANNELS_VIEWED: + handleMultipleChannelsViewedEvent(serverUrl, msg); + break; + case WebsocketEvents.CHANNEL_MEMBER_UPDATED: handleChannelMemberUpdatedEvent(serverUrl, msg); break; diff --git a/app/constants/websocket.ts b/app/constants/websocket.ts index ec1089e04..39ba559e4 100644 --- a/app/constants/websocket.ts +++ b/app/constants/websocket.ts @@ -20,6 +20,7 @@ const WebsocketEvents = { CHANNEL_UNARCHIVED: 'channel_restored', CHANNEL_UPDATED: 'channel_updated', CHANNEL_VIEWED: 'channel_viewed', + MULTIPLE_CHANNELS_VIEWED: 'multiple_channels_viewed', CHANNEL_MEMBER_UPDATED: 'channel_member_updated', CHANNEL_SCHEME_UPDATED: 'channel_scheme_updated', DIRECT_ADDED: 'direct_added', From e08a2b6d313c6573ced2264add10c626b236149c Mon Sep 17 00:00:00 2001 From: chumanoe6a422f4dc064391 Date: Mon, 7 Aug 2023 17:03:11 +0000 Subject: [PATCH 03/94] Translated using Weblate (Vietnamese) Currently translated at 99.9% (1067 of 1068 strings) Translation: mattermost-languages-shipped/mattermost-mobile-v2 Translate-URL: https://translate.mattermost.com/projects/mattermost/mattermost-mobile-v2/vi/ --- assets/base/i18n/vi.json | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/assets/base/i18n/vi.json b/assets/base/i18n/vi.json index e5d340251..1d5d56c98 100644 --- a/assets/base/i18n/vi.json +++ b/assets/base/i18n/vi.json @@ -316,7 +316,7 @@ "mobile.ios.photos_permission_denied_description": "Tải ảnh và video lên phiên bản Mattermost của bạn hoặc lưu chúng vào thiết bị của bạn. Mở Cài đặt để cấp quyền truy cập Đọc và ghi vào thư viện ảnh và video của bạn cho Mattermost.", "mobile.ios.photos_permission_denied_title": "{applicationName} muốn truy cập ảnh của bạn", "mobile.managed.exit": "Chỉnh sửa", - "mobile.managed.jailbreak": "Các thiết bị bẻ khóa không được {vendor} tin cậy, vui lòng thoát khỏi ứng dụng.", + "mobile.managed.jailbreak": "Các thiết bị bẻ khóa không được {vendor} tin cậy.\n \nLý do {reason}\n\n\nThông tin gỡ lỗi: {debug}\n\nVui lòng thoát khỏi ứng dụng.", "mobile.managed.not_secured.android": "Thiết bị này phải được bảo mật bằng khóa màn hình để sử dụng Mattermost.", "mobile.managed.not_secured.ios": "Thiết bị này phải được bảo mật bằng mật mã để sử dụng Mattermost.\n\nChuyển đến Cài đặt > Face ID & Mật mã.", "mobile.managed.not_secured.ios.touchId": "Thiết bị này phải được bảo mật bằng mật mã để sử dụng Mattermost.\n\nChuyển đến Cài đặt > Face ID & Mật mã.", @@ -700,8 +700,8 @@ "settings_display.timezone.off": "Tắt", "settings_display.timezone.select": "Chọn múi giờ", "settings.about": "Về {appTitle}", - "settings.about.database": "Database:", - "settings.about.database.schema": "Database Schema Version:", + "settings.about.database": "Cơ sở dữ liệu: {driverName}", + "settings.about.database.schema": "Phiên Bản Lược Đồ CSDL: {version}", "settings.about.licensed": "Giấy phép được cấp: {company}", "settings.about.powered_by": "{site} được cung cấp bởi Mattermost", "settings.about.server.version.value": "{version} (Bản {number})", @@ -1056,5 +1056,14 @@ "share_extension.count_limit": "Bạn chỉ có thể chia sẻ {count, number} {count, plural, one {tệp} other {tệp}} trên máy chủ này", "share_extension.max_resolution": "Hình ảnh vượt quá kích thước tối đa 7680 x 4320 px", "share_feedback.subtitle": "Chúng tôi muốn biết cách chúng tôi có thể làm cho trải nghiệm của bạn tốt hơn.", - "skintone_selector.tooltip.description": "Giờ đây, bạn có thể chọn tông màu da mà bạn muốn sử dụng cho biểu tượng cảm xúc của mình." + "skintone_selector.tooltip.description": "Giờ đây, bạn có thể chọn tông màu da mà bạn muốn sử dụng cho biểu tượng cảm xúc của mình.", + "settings.about.app.version": "Phiên bản: {version} (Số bản tạo {number})", + "settings.about.app.version.title": "Phiên bản:", + "settings.about.app.version.value": "{version} (Số bản tạo {number})", + "settings.about.button.copyInfo": "Thông tin sao chép", + "settings.about.database.schema.title": "Phiên Bản Lược Đồ CSDL:", + "settings.about.database.title": "Cơ sở dữ liệu:", + "settings.about.server.version": "Phiên bản Máy chủ: {version} (Số bản tạo {buildNumber}", + "settings.about.server.version.noBuild": "Phiên bản Máy chủ: {version}", + "settings.about.server.version.title": "Phiên bản Máy chủ:" } From 848c84baf9fa4d3201ce8489a57824c8f61b24b7 Mon Sep 17 00:00:00 2001 From: jprusch Date: Tue, 8 Aug 2023 06:55:03 +0000 Subject: [PATCH 04/94] Translated using Weblate (German) Currently translated at 100.0% (1069 of 1069 strings) Translation: mattermost-languages-shipped/mattermost-mobile-v2 Translate-URL: https://translate.mattermost.com/projects/mattermost/mattermost-mobile-v2/de/ --- assets/base/i18n/de.json | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/assets/base/i18n/de.json b/assets/base/i18n/de.json index bdf04c6e0..24f6184b8 100644 --- a/assets/base/i18n/de.json +++ b/assets/base/i18n/de.json @@ -1066,5 +1066,6 @@ "settings.about.database.title": "Datenbank:", "settings.about.server.version": "Server Version: {version} (Build {buildNumber}", "settings.about.server.version.title": "Server-Version:", - "settings.about.server.version.noBuild": "Server Version: {version}" + "settings.about.server.version.noBuild": "Server Version: {version}", + "snack.bar.info.copied": "Info in die Zwischenablage kopiert" } From fa2c3ec227b3d59d2a033879ffdbbb668567b576 Mon Sep 17 00:00:00 2001 From: Konstantin Date: Tue, 8 Aug 2023 08:05:07 +0000 Subject: [PATCH 05/94] Translated using Weblate (Russian) Currently translated at 100.0% (1069 of 1069 strings) Translation: mattermost-languages-shipped/mattermost-mobile-v2 Translate-URL: https://translate.mattermost.com/projects/mattermost/mattermost-mobile-v2/ru/ --- assets/base/i18n/ru.json | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/assets/base/i18n/ru.json b/assets/base/i18n/ru.json index 620d4ef9d..c87b1a803 100644 --- a/assets/base/i18n/ru.json +++ b/assets/base/i18n/ru.json @@ -1066,5 +1066,6 @@ "settings.about.database.title": "База данных:", "settings.about.server.version": "Версия сервера: {version} (Build {buildNumber}", "settings.about.server.version.noBuild": "Версия сервера: {version}", - "settings.about.server.version.title": "Версия сервера:" + "settings.about.server.version.title": "Версия сервера:", + "snack.bar.info.copied": "Информация скопирована в буфер обмена" } From 0eed1a48639d5bdc354d77979f0684a57644c2b8 Mon Sep 17 00:00:00 2001 From: master7 Date: Wed, 9 Aug 2023 05:56:10 +0000 Subject: [PATCH 06/94] Translated using Weblate (Polish) Currently translated at 100.0% (1069 of 1069 strings) Translation: mattermost-languages-shipped/mattermost-mobile-v2 Translate-URL: https://translate.mattermost.com/projects/mattermost/mattermost-mobile-v2/pl/ --- assets/base/i18n/pl.json | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/assets/base/i18n/pl.json b/assets/base/i18n/pl.json index 7a83db782..00320b279 100644 --- a/assets/base/i18n/pl.json +++ b/assets/base/i18n/pl.json @@ -1066,5 +1066,6 @@ "settings.about.server.version.noBuild": "Wersja Serwera: {version}", "settings.about.server.version.title": "Wersja serwera:", "settings.about.app.version": "Wersja Aplikacji: {version} (Build {number})", - "settings.about.server.version": "Wersja serwera: {version} (kompilacja {buildNumber}" + "settings.about.server.version": "Wersja serwera: {version} (kompilacja {buildNumber}", + "snack.bar.info.copied": "Informacje skopiowane do schowka" } From e08c94a75e737234500588f2b2cf104b747ccc50 Mon Sep 17 00:00:00 2001 From: MArtin Johnson Date: Tue, 8 Aug 2023 14:15:40 +0000 Subject: [PATCH 07/94] Translated using Weblate (Swedish) Currently translated at 100.0% (1069 of 1069 strings) Translation: mattermost-languages-shipped/mattermost-mobile-v2 Translate-URL: https://translate.mattermost.com/projects/mattermost/mattermost-mobile-v2/sv/ --- assets/base/i18n/sv.json | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/assets/base/i18n/sv.json b/assets/base/i18n/sv.json index 9cd93061e..01c9c2fea 100644 --- a/assets/base/i18n/sv.json +++ b/assets/base/i18n/sv.json @@ -1066,5 +1066,6 @@ "settings.about.database.title": "Databas:", "settings.about.server.version": "Serverversion: {version} (Build {buildNumber}", "settings.about.server.version.noBuild": "Serverversion: {version}", - "settings.about.server.version.title": "Serverversion:" + "settings.about.server.version.title": "Serverversion:", + "snack.bar.info.copied": "Kopierat till clipboard" } From 92ac99db696bf892551012678b627cc7aede5439 Mon Sep 17 00:00:00 2001 From: kaakaa Date: Mon, 14 Aug 2023 02:47:45 +0000 Subject: [PATCH 08/94] Translated using Weblate (Japanese) Currently translated at 100.0% (1069 of 1069 strings) Translation: mattermost-languages-shipped/mattermost-mobile-v2 Translate-URL: https://translate.mattermost.com/projects/mattermost/mattermost-mobile-v2/ja/ --- assets/base/i18n/ja.json | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/assets/base/i18n/ja.json b/assets/base/i18n/ja.json index 602e1f191..896c69277 100644 --- a/assets/base/i18n/ja.json +++ b/assets/base/i18n/ja.json @@ -422,8 +422,8 @@ "settings.about.server.version.value": "{version} (Build {number})", "settings.about.powered_by": "{site} はMattermostを利用しています", "settings.about.licensed": "ライセンス: {company}", - "settings.about.database.schema": "データベーススキーマのバージョン:", - "settings.about.database": "データベース:", + "settings.about.database.schema": "データベーススキーマのバージョン: {version}", + "settings.about.database": "データベース: {driverName}", "settings.about.copyright": "Copyright 2015-{currentYear} Mattermost, Inc. All rights reserved", "settings.about": "{appTitle}について", "settings_display.timezone.select": "タイムゾーンを選択", @@ -1056,5 +1056,16 @@ "share_extension.channels_screen.title": "チャンネルを選択", "share_extension.error_screen.description": "{applicationName} にコンテンツを共有する際にエラーが発生しました。", "share_extension.error_screen.label": "エラーが発生しました", - "share_extension.error_screen.reason": "理由: {reason}" + "share_extension.error_screen.reason": "理由: {reason}", + "snack.bar.info.copied": "情報がクリップボードにコピーされました", + "mobile.search.results": "{count} 件の検索 {count, plural, one {結果} other {結果}}", + "settings.about.app.version": "App Version: {version} (Build {number})", + "settings.about.app.version.title": "App Version:", + "settings.about.app.version.value": "{version} (Build {number})", + "settings.about.button.copyInfo": "情報をコピー", + "settings.about.database.schema.title": "データベーススキーマのバージョン:", + "settings.about.database.title": "データベース:", + "settings.about.server.version": "サーバーのバージョン: {version} (Build {buildNumber})", + "settings.about.server.version.noBuild": "サーバーのバージョン: {version}", + "settings.about.server.version.title": "サーバーのバージョン:" } From 68939c9fcca996429ddb1b02be1a6fcb803e04de Mon Sep 17 00:00:00 2001 From: Elias Nahum Date: Mon, 14 Aug 2023 14:38:05 -0400 Subject: [PATCH 09/94] update reanimated (#7500) * update reanimated * fix reanimated types --- app/components/post_list/post_list.tsx | 6 +++-- app/components/profile_picture/image.tsx | 2 ++ app/components/progressive_image/index.tsx | 4 ++++ .../progressive_image/thumbnail.tsx | 2 ++ app/context/gallery/index.tsx | 8 +++---- app/hooks/header.ts | 24 +++++++++++-------- .../channel_post_list/channel_post_list.tsx | 3 ++- app/screens/gallery/gallery.tsx | 4 ++-- app/screens/gallery/header/index.tsx | 4 ++-- app/screens/gallery/video_renderer/index.tsx | 2 ++ .../home/recent_mentions/recent_mentions.tsx | 2 ++ .../home/saved_messages/saved_messages.tsx | 2 ++ app/screens/home/search/search.tsx | 6 +++-- app/screens/user_profile/title/avatar.tsx | 2 ++ app/utils/gallery/index.ts | 4 ++-- ios/Podfile.lock | 4 ++-- package-lock.json | 14 +++++------ package.json | 2 +- ...ch => react-native-reanimated+3.4.2.patch} | 21 ++++++++++++++-- types/modules/react-native-reanimated.d.ts | 12 ---------- 20 files changed, 79 insertions(+), 49 deletions(-) rename patches/{react-native-reanimated+3.3.0.patch => react-native-reanimated+3.4.2.patch} (59%) delete mode 100644 types/modules/react-native-reanimated.d.ts diff --git a/app/components/post_list/post_list.tsx b/app/components/post_list/post_list.tsx index cd7ae4ed9..f2ad16fac 100644 --- a/app/components/post_list/post_list.tsx +++ b/app/components/post_list/post_list.tsx @@ -4,7 +4,7 @@ import {FlatList} from '@stream-io/flat-list-mvcp'; import React, {type ReactElement, useCallback, useEffect, useMemo, useRef, useState} from 'react'; import {DeviceEventEmitter, type ListRenderItemInfo, type NativeScrollEvent, type NativeSyntheticEvent, Platform, type StyleProp, StyleSheet, type ViewStyle} from 'react-native'; -import Animated from 'react-native-reanimated'; +import Animated, {type AnimatedStyle} from 'react-native-reanimated'; import {fetchPosts, fetchPostThread} from '@actions/remote/post'; import CombinedUserActivity from '@components/post_list/combined_user_activity'; @@ -27,7 +27,7 @@ import type PostModel from '@typings/database/models/servers/post'; type Props = { appsEnabled: boolean; channelId: string; - contentContainerStyle?: StyleProp; + contentContainerStyle?: StyleProp>; currentTimezone: string | null; currentUserId: string; currentUsername: string; @@ -354,6 +354,8 @@ const PostList = ({ onScroll={onScroll} onScrollToIndexFailed={onScrollToIndexFailed} onViewableItemsChanged={onViewableItemsChanged} + + // @ts-expect-error old style ref ref={listRef} removeClippedSubviews={true} renderItem={renderItem} diff --git a/app/components/profile_picture/image.tsx b/app/components/profile_picture/image.tsx index 623b1b0f2..9791f218e 100644 --- a/app/components/profile_picture/image.tsx +++ b/app/components/profile_picture/image.tsx @@ -92,6 +92,8 @@ const Image = ({author, forwardRef, iconSize, size, source, url}: Props) => { return ( diff --git a/app/context/gallery/index.tsx b/app/context/gallery/index.tsx index c766f1e93..df99e4098 100644 --- a/app/context/gallery/index.tsx +++ b/app/context/gallery/index.tsx @@ -1,14 +1,14 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. -import React, {useEffect, useLayoutEffect} from 'react'; -import Animated, {makeMutable, runOnUI} from 'react-native-reanimated'; +import {useEffect, useLayoutEffect} from 'react'; +import Animated, {makeMutable, runOnUI, type AnimatedRef} from 'react-native-reanimated'; import type {GalleryManagerSharedValues} from '@typings/screens/gallery'; export interface GalleryManagerItem { index: number; - ref: React.RefObject; + ref: AnimatedRef; } export interface GalleryManagerItems { @@ -79,7 +79,7 @@ class Gallery { })(); } - public registerItem(index: number, ref: React.RefObject) { + public registerItem(index: number, ref: AnimatedRef) { if (this.items.has(index)) { return; } diff --git a/app/hooks/header.ts b/app/hooks/header.ts index cbfde0357..1f029fa94 100644 --- a/app/hooks/header.ts +++ b/app/hooks/header.ts @@ -95,7 +95,7 @@ export const useCollapsibleHeader = (isLargeTitle: boolean, onSnap?: (offset: return; } - if (ctx.dragging || autoScroll.value || snapping.value) { + if (ctx?.dragging || autoScroll.value || snapping.value) { scrollValue.value = e.contentOffset.y; } else { // here we want to ensure that the scroll position @@ -105,25 +105,29 @@ export const useCollapsibleHeader = (isLargeTitle: boolean, onSnap?: (offset: } }, onEndDrag: (e, ctx) => { - if (ctx.start !== undefined) { + if (ctx?.start !== undefined) { const dir = e.contentOffset.y < ctx.start ? 'down' : 'up'; const offset = Math.abs(e.contentOffset.y); snapIfNeeded(dir, offset); } }, onMomentumBegin: (e, ctx) => { - ctx.momentum = e.contentOffset.y < (ctx.start || 0) ? 'down' : 'up'; + if (ctx) { + ctx.momentum = e.contentOffset.y < (ctx.start || 0) ? 'down' : 'up'; + } }, onMomentumEnd: (e, ctx) => { - ctx.start = undefined; - ctx.dragging = false; - if (ctx.momentum === 'down') { - const offset = Math.abs(e.contentOffset.y); + if (ctx) { + ctx.start = undefined; + ctx.dragging = false; + if (ctx.momentum === 'down') { + const offset = Math.abs(e.contentOffset.y); - if (onSnap && offset < largeHeight) { - runOnJS(onSnap)(0); + if (onSnap && offset < largeHeight) { + runOnJS(onSnap)(0); + } + ctx.momentum = undefined; } - ctx.momentum = undefined; } }, }, [insets, defaultHeight, largeHeight, animatedRef]); diff --git a/app/screens/channel/channel_post_list/channel_post_list.tsx b/app/screens/channel/channel_post_list/channel_post_list.tsx index 87dd035d8..9d43581df 100644 --- a/app/screens/channel/channel_post_list/channel_post_list.tsx +++ b/app/screens/channel/channel_post_list/channel_post_list.tsx @@ -19,10 +19,11 @@ import EphemeralStore from '@store/ephemeral_store'; import Intro from './intro'; import type PostModel from '@typings/database/models/servers/post'; +import type {AnimatedStyle} from 'react-native-reanimated'; type Props = { channelId: string; - contentContainerStyle?: StyleProp; + contentContainerStyle?: StyleProp>; isCRTEnabled: boolean; lastViewedAt: number; nativeID: string; diff --git a/app/screens/gallery/gallery.tsx b/app/screens/gallery/gallery.tsx index 23984406a..815595f63 100644 --- a/app/screens/gallery/gallery.tsx +++ b/app/screens/gallery/gallery.tsx @@ -4,7 +4,7 @@ import React, {forwardRef, useCallback, useEffect, useImperativeHandle, useRef, useState} from 'react'; import {BackHandler} from 'react-native'; import FastImage, {type ImageStyle} from 'react-native-fast-image'; -import Animated, {runOnJS, runOnUI, useAnimatedReaction} from 'react-native-reanimated'; +import Animated, {runOnJS, runOnUI, useAnimatedReaction, type AnimatedStyle} from 'react-native-reanimated'; import {useGallery} from '@context/gallery'; import {freezeOtherScreens, measureItem} from '@utils/gallery'; @@ -148,7 +148,7 @@ const Gallery = forwardRef(({ return ( } /> ); } diff --git a/app/screens/gallery/header/index.tsx b/app/screens/gallery/header/index.tsx index 4645a640b..f67787f50 100644 --- a/app/screens/gallery/header/index.tsx +++ b/app/screens/gallery/header/index.tsx @@ -4,7 +4,7 @@ import React, {useMemo} from 'react'; import {type StyleProp, StyleSheet, useWindowDimensions, View, type ViewStyle} from 'react-native'; import {TouchableOpacity} from 'react-native-gesture-handler'; -import Animated from 'react-native-reanimated'; +import Animated, {type AnimatedStyle} from 'react-native-reanimated'; import {SafeAreaView, type Edge, useSafeAreaInsets} from 'react-native-safe-area-context'; import CompassIcon from '@components/compass_icon'; @@ -16,7 +16,7 @@ import {typography} from '@utils/typography'; type Props = { index: number; onClose: () => void; - style: StyleProp; + style: StyleProp>; total: number; } diff --git a/app/screens/gallery/video_renderer/index.tsx b/app/screens/gallery/video_renderer/index.tsx index f61ed5966..e45c74570 100644 --- a/app/screens/gallery/video_renderer/index.tsx +++ b/app/screens/gallery/video_renderer/index.tsx @@ -170,6 +170,8 @@ const VideoRenderer = ({height, index, initialIndex, item, isPageActive, onShoul return ( <> { handleSearch(newTeamId, lastSearchedValue); }, [lastSearchedValue, handleSearch]); - const initialContainerStyle: ViewStyle = useMemo(() => { + const initialContainerStyle: AnimatedStyle = useMemo(() => { return { paddingTop: scrollPaddingTop, flexGrow: 1, @@ -396,6 +396,8 @@ const SearchScreen = ({teamId, teams}: Props) => { removeClippedSubviews={false} scrollToOverflowEnabled={true} overScrollMode='always' + + // @ts-expect-error old style ref ref={scrollRef} renderItem={renderInitialOrLoadingItem} /> diff --git a/app/screens/user_profile/title/avatar.tsx b/app/screens/user_profile/title/avatar.tsx index 41e7be256..1dfbe52a9 100644 --- a/app/screens/user_profile/title/avatar.tsx +++ b/app/screens/user_profile/title/avatar.tsx @@ -42,6 +42,8 @@ const UserProfileAvatar = ({enablePostIconOverride, forwardRef, imageSize, user, return ( , sharedValues: GalleryManagerSharedValues) { +export function measureItem(ref: AnimatedRef, sharedValues: GalleryManagerSharedValues) { 'worklet'; try { diff --git a/ios/Podfile.lock b/ios/Podfile.lock index ac6311b7e..97bb30976 100644 --- a/ios/Podfile.lock +++ b/ios/Podfile.lock @@ -528,7 +528,7 @@ PODS: - React-Core - RNReactNativeHapticFeedback (2.0.3): - React-Core - - RNReanimated (3.3.0): + - RNReanimated (3.4.2): - DoubleConversion - FBLazyVector - FBReactNativeSpec @@ -987,7 +987,7 @@ SPEC CHECKSUMS: RNLocalize: 5944c97d2fe8150913a51ddd5eab4e23a82bd80d RNPermissions: cf3a9da0e6e6772e66282ca7338e198885ac70e7 RNReactNativeHapticFeedback: afa5bf2794aecbb2dba2525329253da0d66656df - RNReanimated: 9976fbaaeb8a188c36026154c844bf374b3b7eeb + RNReanimated: 49cdb63e767bb7e743ff4c12f7d85722c0d008f2 RNRudderSdk: 70865f8d0746d7e78e27df98c148d1ca0205c551 RNScreens: d037903436160a4b039d32606668350d2a808806 RNSentry: 9f0447b3ce13806f544903748de423259ead8552 diff --git a/package-lock.json b/package-lock.json index 17c7d6ad7..7ce1a6666 100644 --- a/package-lock.json +++ b/package-lock.json @@ -81,7 +81,7 @@ "react-native-navigation": "7.33.4", "react-native-notifications": "4.3.5", "react-native-permissions": "3.8.0", - "react-native-reanimated": "3.3.0", + "react-native-reanimated": "3.4.2", "react-native-safe-area-context": "4.5.3", "react-native-screens": "3.21.0", "react-native-section-list-get-item-layout": "2.2.3", @@ -18452,9 +18452,9 @@ } }, "node_modules/react-native-reanimated": { - "version": "3.3.0", - "resolved": "https://registry.npmjs.org/react-native-reanimated/-/react-native-reanimated-3.3.0.tgz", - "integrity": "sha512-LzfpPZ1qXBGy5BcUHqw3pBC0qSd22qXS3t8hWSbozXNrBkzMhhOrcILE/nEg/PHpNNp1xvGOW8NwpAMF006roQ==", + "version": "3.4.2", + "resolved": "https://registry.npmjs.org/react-native-reanimated/-/react-native-reanimated-3.4.2.tgz", + "integrity": "sha512-FbtG+f1PB005vDTJSv4zAnTK7nNXi+FjFgbAM5gOzIZDajfph2BFMSUstzIsN8T77+OKuugUBmcTqLnQ24EBVg==", "dependencies": { "@babel/plugin-transform-object-assign": "^7.16.7", "@babel/preset-typescript": "^7.16.7", @@ -35422,9 +35422,9 @@ } }, "react-native-reanimated": { - "version": "3.3.0", - "resolved": "https://registry.npmjs.org/react-native-reanimated/-/react-native-reanimated-3.3.0.tgz", - "integrity": "sha512-LzfpPZ1qXBGy5BcUHqw3pBC0qSd22qXS3t8hWSbozXNrBkzMhhOrcILE/nEg/PHpNNp1xvGOW8NwpAMF006roQ==", + "version": "3.4.2", + "resolved": "https://registry.npmjs.org/react-native-reanimated/-/react-native-reanimated-3.4.2.tgz", + "integrity": "sha512-FbtG+f1PB005vDTJSv4zAnTK7nNXi+FjFgbAM5gOzIZDajfph2BFMSUstzIsN8T77+OKuugUBmcTqLnQ24EBVg==", "requires": { "@babel/plugin-transform-object-assign": "^7.16.7", "@babel/preset-typescript": "^7.16.7", diff --git a/package.json b/package.json index 397fdd4fb..0a663d36d 100644 --- a/package.json +++ b/package.json @@ -78,7 +78,7 @@ "react-native-navigation": "7.33.4", "react-native-notifications": "4.3.5", "react-native-permissions": "3.8.0", - "react-native-reanimated": "3.3.0", + "react-native-reanimated": "3.4.2", "react-native-safe-area-context": "4.5.3", "react-native-screens": "3.21.0", "react-native-section-list-get-item-layout": "2.2.3", diff --git a/patches/react-native-reanimated+3.3.0.patch b/patches/react-native-reanimated+3.4.2.patch similarity index 59% rename from patches/react-native-reanimated+3.3.0.patch rename to patches/react-native-reanimated+3.4.2.patch index 5f4cf2898..7163469ae 100644 --- a/patches/react-native-reanimated+3.3.0.patch +++ b/patches/react-native-reanimated+3.4.2.patch @@ -1,8 +1,25 @@ +diff --git a/node_modules/react-native-reanimated/lib/typescript/reanimated2/hook/utils.d.ts b/node_modules/react-native-reanimated/lib/typescript/reanimated2/hook/utils.d.ts +index 67c921b..cbb6f83 100644 +--- a/node_modules/react-native-reanimated/lib/typescript/reanimated2/hook/utils.d.ts ++++ b/node_modules/react-native-reanimated/lib/typescript/reanimated2/hook/utils.d.ts +@@ -9,7 +9,11 @@ interface Handlers { + [key: string]: Handler | undefined; + } + type useEventType = (handler: (e: T) => void, eventNames?: string[], rebuild?: boolean) => (e: NativeSyntheticEvent) => void; +-export declare const useEvent: useEventType; ++export declare function useEvent( ++ handler: T, ++ events: string[], ++ rebuild: boolean, ++): K; + type useHandlerType = >(handlers: Handlers, deps?: DependencyList) => { + context: TContext; + doDependenciesDiffer: boolean; diff --git a/node_modules/react-native-reanimated/src/reanimated2/mutables.ts b/node_modules/react-native-reanimated/src/reanimated2/mutables.ts -index 90de1f1..ae59355 100644 +index 6c4213d..e3cc49c 100644 --- a/node_modules/react-native-reanimated/src/reanimated2/mutables.ts +++ b/node_modules/react-native-reanimated/src/reanimated2/mutables.ts -@@ -95,25 +95,25 @@ export function makeMutable( +@@ -94,25 +94,25 @@ export function makeMutable( } return value; }, diff --git a/types/modules/react-native-reanimated.d.ts b/types/modules/react-native-reanimated.d.ts deleted file mode 100644 index d9fc066d8..000000000 --- a/types/modules/react-native-reanimated.d.ts +++ /dev/null @@ -1,12 +0,0 @@ -// Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. -// See LICENSE.txt for license information. - -declare module 'react-native-reanimated' { - function makeRemote(value: T): T; - - function useEvent( - handler: T, - events: string[], - rebuild: boolean, - ): K; -} From 10cb9a6087623a8d231a99f5dbaa82095aef9f8a Mon Sep 17 00:00:00 2001 From: Elias Nahum Date: Mon, 14 Aug 2023 16:28:37 -0400 Subject: [PATCH 10/94] Bump app build number to 482 (#7503) --- 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 2157a9fe5..ec4ffb1e8 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 481 + versionCode 482 versionName "2.7.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 3b8b54b57..cbe3fdd24 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 = 481; + CURRENT_PROJECT_VERSION = 482; 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 = 481; + CURRENT_PROJECT_VERSION = 482; 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 = 481; + CURRENT_PROJECT_VERSION = 482; 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 = 481; + CURRENT_PROJECT_VERSION = 482; 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 6da327de8..ca337144d 100644 --- a/ios/Mattermost/Info.plist +++ b/ios/Mattermost/Info.plist @@ -37,7 +37,7 @@ CFBundleVersion - 481 + 482 ITSAppUsesNonExemptEncryption LSRequiresIPhoneOS diff --git a/ios/MattermostShare/Info.plist b/ios/MattermostShare/Info.plist index 55f3f146e..920a65cda 100644 --- a/ios/MattermostShare/Info.plist +++ b/ios/MattermostShare/Info.plist @@ -21,7 +21,7 @@ CFBundleShortVersionString 2.7.0 CFBundleVersion - 481 + 482 UIAppFonts OpenSans-Bold.ttf diff --git a/ios/NotificationService/Info.plist b/ios/NotificationService/Info.plist index eba59970c..8b4abd33e 100644 --- a/ios/NotificationService/Info.plist +++ b/ios/NotificationService/Info.plist @@ -21,7 +21,7 @@ CFBundleShortVersionString 2.7.0 CFBundleVersion - 481 + 482 NSExtension NSExtensionPointIdentifier From 3b6dd923dfe1537f727584d997fdbc5d25f665af Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pablo=20Andr=C3=A9s=20V=C3=A9lez=20Vidal?= Date: Tue, 15 Aug 2023 15:47:26 +0200 Subject: [PATCH 11/94] MM-53849 - hide channels from archived teams during channels search --- .../find_channels/filtered_list/index.ts | 5 ++++- .../find_channels/unfiltered_list/index.ts | 9 +++++++-- app/screens/find_channels/utils.ts | 17 ++++++++++++++++- 3 files changed, 27 insertions(+), 4 deletions(-) diff --git a/app/screens/find_channels/filtered_list/index.ts b/app/screens/find_channels/filtered_list/index.ts index ce6d5c060..e887cb4ce 100644 --- a/app/screens/find_channels/filtered_list/index.ts +++ b/app/screens/find_channels/filtered_list/index.ts @@ -12,7 +12,7 @@ import {observeConfigValue, observeCurrentTeamId} from '@queries/servers/system' import {queryJoinedTeams} from '@queries/servers/team'; import {observeIsCRTEnabled} from '@queries/servers/thread'; import {observeTeammateNameDisplay} from '@queries/servers/user'; -import {retrieveChannels} from '@screens/find_channels/utils'; +import {removeChannelsFromArchivedTeams, retrieveChannels} from '@screens/find_channels/utils'; import FilteredList, {MAX_RESULTS} from './filtered_list'; @@ -37,11 +37,14 @@ const enhanced = withObservables(['term'], ({database, term}: EnhanceProps) => { switchMap((matchStart) => { return retrieveChannels(database, matchStart.flat(), true); }), + switchMap((myChannels) => removeChannelsFromArchivedTeams(myChannels, teamIds)), ); const channelsMatch = joinedChannelsMatch.pipe( combineLatestWith(directChannelsMatch), switchMap((matched) => retrieveChannels(database, matched.flat(), true)), + switchMap((myChannels) => removeChannelsFromArchivedTeams(myChannels, teamIds)), + ); const archivedChannels = observeArchiveChannelsByTerm(database, term, MAX_RESULTS).pipe( diff --git a/app/screens/find_channels/unfiltered_list/index.ts b/app/screens/find_channels/unfiltered_list/index.ts index e094d6df3..cf5407cd9 100644 --- a/app/screens/find_channels/unfiltered_list/index.ts +++ b/app/screens/find_channels/unfiltered_list/index.ts @@ -3,12 +3,12 @@ import {withDatabase} from '@nozbe/watermelondb/DatabaseProvider'; import withObservables from '@nozbe/with-observables'; -import {of as of$} from 'rxjs'; +import {Observable, of as of$} from 'rxjs'; import {switchMap} from 'rxjs/operators'; import {queryMyRecentChannels} from '@queries/servers/channel'; import {queryJoinedTeams} from '@queries/servers/team'; -import {retrieveChannels} from '@screens/find_channels/utils'; +import {removeChannelsFromArchivedTeams, retrieveChannels} from '@screens/find_channels/utils'; import UnfilteredList from './unfiltered_list'; @@ -18,10 +18,15 @@ const MAX_CHANNELS = 20; const enhanced = withObservables([], ({database}: WithDatabaseArgs) => { const teamsCount = queryJoinedTeams(database).observeCount(); + const teamIds: Observable> = queryJoinedTeams(database).observe().pipe( + // eslint-disable-next-line max-nested-callbacks + switchMap((teams) => of$(new Set(teams.map((t) => t.id)))), + ); const recentChannels = queryMyRecentChannels(database, MAX_CHANNELS). observeWithColumns(['last_viewed_at']).pipe( switchMap((myChannels) => retrieveChannels(database, myChannels, true)), + switchMap((myChannels) => removeChannelsFromArchivedTeams(myChannels, teamIds)), ); return { diff --git a/app/screens/find_channels/utils.ts b/app/screens/find_channels/utils.ts index 11f504bbe..5065ac411 100644 --- a/app/screens/find_channels/utils.ts +++ b/app/screens/find_channels/utils.ts @@ -2,7 +2,7 @@ // See LICENSE.txt for license information. import {Database, Q} from '@nozbe/watermelondb'; -import {of as of$} from 'rxjs'; +import {Observable, of as of$, switchMap} from 'rxjs'; import {MM_TABLES} from '@constants/database'; @@ -25,3 +25,18 @@ export const retrieveChannels = (database: Database, myChannels: MyChannelModel[ return of$([]); }; + +export const removeChannelsFromArchivedTeams = (recentChannels: ChannelModel[], teamIds: Observable>) => { + return teamIds.pipe( + // eslint-disable-next-line max-nested-callbacks + switchMap((teamIdsSet) => + // eslint-disable-next-line max-nested-callbacks + of$(recentChannels.filter((channel) => { + if (!channel.teamId) { + return true; + } + return teamIdsSet.has(channel.teamId); + })), + ), + ); +}; From bc1ad7362f726d1d199994766c46c273b58ba658 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Espino=20Garc=C3=ADa?= Date: Wed, 16 Aug 2023 17:41:39 +0200 Subject: [PATCH 12/94] Fix login not doing entry logic after forced logout (#7507) * Fix login not doing entry logic after forced logout * Fix lint --- app/managers/websocket_manager.ts | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/app/managers/websocket_manager.ts b/app/managers/websocket_manager.ts index 80742c383..ca8e0bc3e 100644 --- a/app/managers/websocket_manager.ts +++ b/app/managers/websocket_manager.ts @@ -147,7 +147,11 @@ class WebsocketManager { if (error) { client.close(false); } - this.firstConnectionSynced[serverUrl] = true; + + // Makes sure a client still exist, and therefore we haven't been logged out + if (this.clients[serverUrl]) { + this.firstConnectionSynced[serverUrl] = true; + } } } }; From d193ffd3beb99284adb02eb66448d4e15ea5cc4b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Espino=20Garc=C3=ADa?= Date: Thu, 17 Aug 2023 16:06:43 +0200 Subject: [PATCH 13/94] Update supported_server.ts (#7509) Co-authored-by: Mattermost Build --- app/constants/supported_server.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/constants/supported_server.ts b/app/constants/supported_server.ts index ab77763ab..4bf0af9ee 100644 --- a/app/constants/supported_server.ts +++ b/app/constants/supported_server.ts @@ -4,7 +4,7 @@ export const MIN_REQUIRED_VERSION = '5.26.2'; export const FULL_VERSION = '7.8.0'; export const MAJOR_VERSION = 7; -export const MIN_VERSION = 1; +export const MIN_VERSION = 8; export const PATCH_VERSION = 0; export default { From 504caa8cd81e77897d1665e3f790b8a35619dbc3 Mon Sep 17 00:00:00 2001 From: Harshal sanghvi Date: Fri, 18 Aug 2023 16:03:54 +0530 Subject: [PATCH 14/94] Fixed error message position in edit profile screen (#7483) * added last viewed feature * added constants * storing data in global table and added server col * fixed stack screen" * fixed values for crt * fixed threadid store logic * added status on profile in bottom tabs * fixed error for profile edit * refactored and removed rule from eslint * fixed variable in username field --- app/screens/edit_profile/components/field.tsx | 3 +++ app/screens/edit_profile/components/form.tsx | 10 ++++++++-- app/screens/edit_profile/edit_profile.tsx | 11 ++++++++++- 3 files changed, 21 insertions(+), 3 deletions(-) diff --git a/app/screens/edit_profile/components/field.tsx b/app/screens/edit_profile/components/field.tsx index 90a521e09..517952807 100644 --- a/app/screens/edit_profile/components/field.tsx +++ b/app/screens/edit_profile/components/field.tsx @@ -18,6 +18,7 @@ export type FieldProps = TextInputProps & { onTextChange: (fieldKey: string, value: string) => void; isOptional?: boolean; testID: string; + error?: string; value: string; fieldRef: RefObject; onFocusNextField: (fieldKey: string) => void; @@ -49,6 +50,7 @@ const Field = ({ testID, value, fieldRef, + error, onFocusNextField, ...props }: FieldProps) => { @@ -91,6 +93,7 @@ const Field = ({ onChangeText={onChangeText} testID={fieldInputTestId} theme={theme} + error={error} value={value} ref={fieldRef} onSubmitEditing={onSubmitEditing} diff --git a/app/screens/edit_profile/components/form.tsx b/app/screens/edit_profile/components/form.tsx index b58bca90c..5d2c105af 100644 --- a/app/screens/edit_profile/components/form.tsx +++ b/app/screens/edit_profile/components/form.tsx @@ -7,6 +7,7 @@ import {Keyboard, StyleSheet, View} from 'react-native'; import {useTheme} from '@context/theme'; import {t} from '@i18n'; +import {getErrorMessage} from '@utils/errors'; import DisabledFields from './disabled_fields'; import EmailField from './email_field'; @@ -25,6 +26,7 @@ type Props = { lockedNickname: boolean; lockedPosition: boolean; onUpdateField: (fieldKey: string, name: string) => void; + error?: unknown; userInfo: UserInfo; submitUser: () => void; } @@ -72,10 +74,10 @@ const styles = StyleSheet.create({ const ProfileForm = ({ canSave, currentUser, isTablet, lockedFirstName, lockedLastName, lockedNickname, lockedPosition, - onUpdateField, userInfo, submitUser, + onUpdateField, userInfo, submitUser, error, }: Props) => { const theme = useTheme(); - const {formatMessage} = useIntl(); + const intl = useIntl(); const firstNameRef = useRef(null); const lastNameRef = useRef(null); const usernameRef = useRef(null); @@ -83,6 +85,9 @@ const ProfileForm = ({ const nicknameRef = useRef(null); const positionRef = useRef(null); + const {formatMessage} = intl; + const errorMessage = error == null ? undefined : getErrorMessage(error, intl) as string; + const userProfileFields: FieldSequence = useMemo(() => { const service = currentUser.authService; return { @@ -187,6 +192,7 @@ const ProfileForm = ({ (); + const [usernameError, setUsernameError] = useState(); const [updating, setUpdating] = useState(false); const buttonText = intl.formatMessage({id: 'mobile.account.settings.save', defaultMessage: 'Save'}); @@ -149,7 +150,7 @@ const EditProfile = ({ if (hasUpdateUserInfo.current) { const {error: reqError} = await updateMe(serverUrl, newUserInfo); if (reqError) { - resetScreen(reqError); + resetScreenForProfileError(reqError); return; } } @@ -181,6 +182,13 @@ const EditProfile = ({ enableSaveButton(didChange); }, [userInfo, currentUser, enableSaveButton]); + const resetScreenForProfileError = useCallback((resetError: unknown) => { + setUsernameError(resetError); + Keyboard.dismiss(); + setUpdating(false); + enableSaveButton(true); + }, [enableSaveButton]); + const resetScreen = useCallback((resetError: unknown) => { setError(resetError); Keyboard.dismiss(); @@ -220,6 +228,7 @@ const EditProfile = ({ lockedLastName={lockedLastName} lockedNickname={lockedNickname} lockedPosition={lockedPosition} + error={usernameError} onUpdateField={onUpdateField} userInfo={userInfo} submitUser={submitUser} From 109dd21a8a61bf705f00939193e2eb9c53c86166 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pablo=20Andr=C3=A9s=20V=C3=A9lez=20Vidal?= Date: Fri, 18 Aug 2023 13:55:52 +0200 Subject: [PATCH 15/94] refactor code based on pr comments --- .../find_channels/filtered_list/index.ts | 7 +++--- .../find_channels/unfiltered_list/index.ts | 5 +++-- app/screens/find_channels/utils.ts | 22 +++++++------------ 3 files changed, 15 insertions(+), 19 deletions(-) diff --git a/app/screens/find_channels/filtered_list/index.ts b/app/screens/find_channels/filtered_list/index.ts index e887cb4ce..93d0bbc3d 100644 --- a/app/screens/find_channels/filtered_list/index.ts +++ b/app/screens/find_channels/filtered_list/index.ts @@ -37,14 +37,15 @@ const enhanced = withObservables(['term'], ({database, term}: EnhanceProps) => { switchMap((matchStart) => { return retrieveChannels(database, matchStart.flat(), true); }), - switchMap((myChannels) => removeChannelsFromArchivedTeams(myChannels, teamIds)), + combineLatestWith(teamIds), + switchMap(([myChannels, tmIds]) => of$(removeChannelsFromArchivedTeams(myChannels, tmIds))), ); const channelsMatch = joinedChannelsMatch.pipe( combineLatestWith(directChannelsMatch), switchMap((matched) => retrieveChannels(database, matched.flat(), true)), - switchMap((myChannels) => removeChannelsFromArchivedTeams(myChannels, teamIds)), - + combineLatestWith(teamIds), + switchMap(([myChannels, tmIds]) => of$(removeChannelsFromArchivedTeams(myChannels, tmIds))), ); const archivedChannels = observeArchiveChannelsByTerm(database, term, MAX_RESULTS).pipe( diff --git a/app/screens/find_channels/unfiltered_list/index.ts b/app/screens/find_channels/unfiltered_list/index.ts index cf5407cd9..433b47da2 100644 --- a/app/screens/find_channels/unfiltered_list/index.ts +++ b/app/screens/find_channels/unfiltered_list/index.ts @@ -4,7 +4,7 @@ import {withDatabase} from '@nozbe/watermelondb/DatabaseProvider'; import withObservables from '@nozbe/with-observables'; import {Observable, of as of$} from 'rxjs'; -import {switchMap} from 'rxjs/operators'; +import {combineLatestWith, switchMap} from 'rxjs/operators'; import {queryMyRecentChannels} from '@queries/servers/channel'; import {queryJoinedTeams} from '@queries/servers/team'; @@ -26,7 +26,8 @@ const enhanced = withObservables([], ({database}: WithDatabaseArgs) => { const recentChannels = queryMyRecentChannels(database, MAX_CHANNELS). observeWithColumns(['last_viewed_at']).pipe( switchMap((myChannels) => retrieveChannels(database, myChannels, true)), - switchMap((myChannels) => removeChannelsFromArchivedTeams(myChannels, teamIds)), + combineLatestWith(teamIds), + switchMap(([myChannels, tmIds]) => of$(removeChannelsFromArchivedTeams(myChannels, tmIds))), ); return { diff --git a/app/screens/find_channels/utils.ts b/app/screens/find_channels/utils.ts index 5065ac411..7c559711c 100644 --- a/app/screens/find_channels/utils.ts +++ b/app/screens/find_channels/utils.ts @@ -2,7 +2,7 @@ // See LICENSE.txt for license information. import {Database, Q} from '@nozbe/watermelondb'; -import {Observable, of as of$, switchMap} from 'rxjs'; +import {of as of$} from 'rxjs'; import {MM_TABLES} from '@constants/database'; @@ -26,17 +26,11 @@ export const retrieveChannels = (database: Database, myChannels: MyChannelModel[ return of$([]); }; -export const removeChannelsFromArchivedTeams = (recentChannels: ChannelModel[], teamIds: Observable>) => { - return teamIds.pipe( - // eslint-disable-next-line max-nested-callbacks - switchMap((teamIdsSet) => - // eslint-disable-next-line max-nested-callbacks - of$(recentChannels.filter((channel) => { - if (!channel.teamId) { - return true; - } - return teamIdsSet.has(channel.teamId); - })), - ), - ); +export const removeChannelsFromArchivedTeams = (recentChannels: ChannelModel[], teamIds: Set) => { + return recentChannels.filter((channel) => { + if (!channel.teamId) { + return true; + } + return teamIds.has(channel.teamId); + }); }; From 69872eb678e87903715d0f02ac670d6443f04aa1 Mon Sep 17 00:00:00 2001 From: Elias Nahum Date: Fri, 18 Aug 2023 16:04:28 -0400 Subject: [PATCH 16/94] Upgrade Dependencies (#7491) * update dependencies * update dependencies * update readable-stream * further updates --- .eslintrc.json | 1 + .solidarity | 2 +- .../res/drawable/rn_edit_text_material.xml | 2 +- android/gradle.properties | 2 +- app/screens/invite/selection_team_bar.tsx | 4 +- ios/Mattermost.xcodeproj/project.pbxproj | 8 +- .../xcshareddata/swiftpm/Package.resolved | 2 +- ios/Podfile.lock | 141 +- jest.config.js | 5 + package-lock.json | 10517 ++++++++++------ package.json | 144 +- ...eact-native-community+netinfo+9.4.1.patch} | 0 ...rstack+rudder-sdk-react-native+1.7.1.patch | 14 - ....54.0.patch => @sentry+utils+7.63.0.patch} | 0 ... => react-native-device-info+10.8.0.patch} | 0 ...atch => react-native-keychain+8.1.2.patch} | 0 ...h => react-native-navigation+7.37.0.patch} | 93 +- ...=> react-native-notifications+5.0.0.patch} | 58 +- ...react-native-safe-area-context+4.7.1.patch | 11 + ...0.patch => react-native-svg+13.11.0.patch} | 18 +- scripts/preinstall.sh | 2 +- 21 files changed, 6610 insertions(+), 4414 deletions(-) rename patches/{@react-native-community+netinfo+9.3.10.patch => @react-native-community+netinfo+9.4.1.patch} (100%) delete mode 100644 patches/@rudderstack+rudder-sdk-react-native+1.7.1.patch rename patches/{@sentry+utils+7.54.0.patch => @sentry+utils+7.63.0.patch} (100%) rename patches/{react-native-device-info+10.6.0.patch => react-native-device-info+10.8.0.patch} (100%) rename patches/{react-native-keychain+8.1.1.patch => react-native-keychain+8.1.2.patch} (100%) rename patches/{react-native-navigation+7.33.4.patch => react-native-navigation+7.37.0.patch} (78%) rename patches/{react-native-notifications+4.3.5.patch => react-native-notifications+5.0.0.patch} (95%) create mode 100644 patches/react-native-safe-area-context+4.7.1.patch rename patches/{react-native-svg+13.9.0.patch => react-native-svg+13.11.0.patch} (58%) diff --git a/.eslintrc.json b/.eslintrc.json index 0d0323071..229d31473 100644 --- a/.eslintrc.json +++ b/.eslintrc.json @@ -61,6 +61,7 @@ "afterColon": true }}], "@typescript-eslint/member-delimiter-style": 2, + "@typescript-eslint/no-unsafe-declaration-merging": "off", "import/order": [ 2, { diff --git a/.solidarity b/.solidarity index 5ad4be2b1..98568a68b 100644 --- a/.solidarity +++ b/.solidarity @@ -57,7 +57,7 @@ { "rule": "cli", "binary": "pod", - "semver": "1.11.3", + "semver": "1.12.1", "platform": "darwin" } ], diff --git a/android/app/src/main/res/drawable/rn_edit_text_material.xml b/android/app/src/main/res/drawable/rn_edit_text_material.xml index bb6f578c3..ab58c0f44 100644 --- a/android/app/src/main/res/drawable/rn_edit_text_material.xml +++ b/android/app/src/main/res/drawable/rn_edit_text_material.xml @@ -16,7 +16,7 @@ android:insetTop="@dimen/abc_edit_text_inset_top_material" android:insetBottom="@dimen/abc_edit_text_inset_bottom_material"> -