From f3b1508ec809d4c591620a72006a949e92ec191b Mon Sep 17 00:00:00 2001 From: HuyNguyen Date: Mon, 21 Oct 2024 09:58:59 +0700 Subject: [PATCH 1/5] TW-1862: Fix can't display message in chat --- lib/pages/chat/chat.dart | 15 ++++++++++++-- pubspec.lock | 45 +++++++++++++--------------------------- pubspec.yaml | 2 +- 3 files changed, 28 insertions(+), 34 deletions(-) diff --git a/lib/pages/chat/chat.dart b/lib/pages/chat/chat.dart index bb40972b9c..e27c0e2812 100644 --- a/lib/pages/chat/chat.dart +++ b/lib/pages/chat/chat.dart @@ -354,12 +354,14 @@ class ChatController extends State Future requestHistory({ int? historyCount, + StateFilter? filter, }) async { if (!timeline!.canRequestHistory) return; Logs().v('Chat::requestHistory(): Requesting history...'); try { return timeline!.requestHistory( historyCount: historyCount ?? _loadHistoryCount, + filter: filter, ); } catch (err) { ScaffoldMessenger.of(context).showSnackBar( @@ -1748,10 +1750,19 @@ class ChatController extends State if (allMembershipEvents || canRequestHistory) { try { await requestHistory(historyCount: _defaultEventCountDisplay) - .then((response) { - Logs().d( + .then((response) async { + Logs().v( 'Chat::_tryRequestHistory():: Try request history success', ); + if (allMembershipEvents) { + await requestHistory( + historyCount: _defaultEventCountDisplay, + filter: StateFilter( + lazyLoadMembers: true, + types: [EventTypes.Message], + ), + ); + } }); } catch (e) { Logs().e( diff --git a/pubspec.lock b/pubspec.lock index 603291dfe2..602aed0f82 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -1362,7 +1362,7 @@ packages: description: path: "." ref: main - resolved-ref: b902d115c4e6680b353302c0eba74bf66fffd29a + resolved-ref: "08e1e697919615410f8a855e500ef5617f90333b" url: "git@github.com:linagora/future-loading-dialog.git" source: git version: "0.3.0" @@ -1414,6 +1414,14 @@ packages: url: "https://pub.dev" source: hosted version: "14.1.2" + google_fonts: + dependency: "direct main" + description: + name: google_fonts + sha256: "6b6f10f0ce3c42f6552d1c70d2c28d764cf22bb487f50f66cca31dcd5194f4d6" + url: "https://pub.dev" + source: hosted + version: "4.0.4" gradient_borders: dependency: transitive description: @@ -1783,15 +1791,6 @@ packages: url: "git@github.com:linagora/linagora-design-flutter.git" source: git version: "0.0.1" - linkfy_text: - dependency: "direct main" - description: - path: "." - ref: main - resolved-ref: "6690e87f19e024d70b68efbc70d2159c34b5d0fc" - url: "git@github.com:linagora/linkfy_text.git" - source: git - version: "1.1.6" lints: dependency: transitive description: @@ -1877,7 +1876,7 @@ packages: description: path: "." ref: "twake-supported-0.22.6" - resolved-ref: "345aab06d195035c48784b23c849825a61c5a79a" + resolved-ref: "8435e632d7bce166085c6426fbfb4173457526f9" url: "git@github.com:linagora/matrix-dart-sdk.git" source: git version: "0.22.6" @@ -1886,7 +1885,7 @@ packages: description: path: "." ref: main - resolved-ref: "9353b6d6b6c1b9cc9e9a9290ffd0c777c6a0b479" + resolved-ref: a498051a8a7e41a35bde65f37c25add3f808b929 url: "https://github.com/linagora/dart_matrix_api_lite.git" source: git version: "1.7.4" @@ -2324,14 +2323,6 @@ packages: url: "https://pub.dev" source: hosted version: "1.5.1" - pretty_qr_code: - dependency: "direct main" - description: - name: pretty_qr_code - sha256: cbdb4af29da1c1fa21dd76f809646c591320ab9e435d3b0eab867492d43607d5 - url: "https://pub.dev" - source: hosted - version: "3.3.0" process: dependency: transitive description: @@ -2372,14 +2363,6 @@ packages: url: "https://pub.dev" source: hosted version: "1.2.3" - pull_down_button: - dependency: "direct main" - description: - name: pull_down_button - sha256: "12cdd8ff187a3150ebdf075e5074299f085579b158d2b4e655ccbafccf95f25b" - url: "https://pub.dev" - source: hosted - version: "0.10.2" punycode: dependency: "direct main" description: @@ -3007,10 +2990,10 @@ packages: dependency: "direct main" description: name: url_launcher - sha256: "9d06212b1362abc2f0f0d78e6f09f726608c74e3b9462e8368bb03314aa8d603" + sha256: "6ce1e04375be4eed30548f10a315826fd933c1e493206eab82eed01f438c8d2e" url: "https://pub.dev" source: hosted - version: "6.3.1" + version: "6.2.6" url_launcher_android: dependency: transitive description: @@ -3402,4 +3385,4 @@ packages: version: "3.1.2" sdks: dart: ">=3.5.0-259.0.dev <4.0.0" - flutter: ">=3.19.3" + flutter: ">=3.19.0" diff --git a/pubspec.yaml b/pubspec.yaml index 28f07cbd49..e6df5fec66 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -12,7 +12,7 @@ dependencies: matrix: git: url: git@github.com:linagora/matrix-dart-sdk.git - ref: twake-supported-0.22.6 + ref: support-filter-for-request-history receive_sharing_intent: git: From 20aa4a004518cda800a012b8e20ca7ff6c6c83c3 Mon Sep 17 00:00:00 2001 From: "khaled.njim" Date: Fri, 29 Nov 2024 12:26:26 +0100 Subject: [PATCH 2/5] fixup! TW-1862: Fix can't display message in chat --- lib/pages/chat/chat.dart | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/lib/pages/chat/chat.dart b/lib/pages/chat/chat.dart index e27c0e2812..60fcca5257 100644 --- a/lib/pages/chat/chat.dart +++ b/lib/pages/chat/chat.dart @@ -1759,7 +1759,11 @@ class ChatController extends State historyCount: _defaultEventCountDisplay, filter: StateFilter( lazyLoadMembers: true, - types: [EventTypes.Message], + types: [ + EventTypes.Message, + EventTypes.Encrypted, + EventTypes.Sticker, + ], ), ); } From 14fd1324e330d2c9288a743fe65101b6120450a0 Mon Sep 17 00:00:00 2001 From: HuyNguyen Date: Mon, 9 Dec 2024 16:21:39 +0700 Subject: [PATCH 3/5] fixup! fixup! TW-1862: Fix can't display message in chat --- pubspec.lock | 43 ++++++++++++++++++++++++++++++------------- 1 file changed, 30 insertions(+), 13 deletions(-) diff --git a/pubspec.lock b/pubspec.lock index 602aed0f82..830687ac50 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -1362,7 +1362,7 @@ packages: description: path: "." ref: main - resolved-ref: "08e1e697919615410f8a855e500ef5617f90333b" + resolved-ref: b902d115c4e6680b353302c0eba74bf66fffd29a url: "git@github.com:linagora/future-loading-dialog.git" source: git version: "0.3.0" @@ -1414,14 +1414,6 @@ packages: url: "https://pub.dev" source: hosted version: "14.1.2" - google_fonts: - dependency: "direct main" - description: - name: google_fonts - sha256: "6b6f10f0ce3c42f6552d1c70d2c28d764cf22bb487f50f66cca31dcd5194f4d6" - url: "https://pub.dev" - source: hosted - version: "4.0.4" gradient_borders: dependency: transitive description: @@ -1791,6 +1783,15 @@ packages: url: "git@github.com:linagora/linagora-design-flutter.git" source: git version: "0.0.1" + linkfy_text: + dependency: "direct main" + description: + path: "." + ref: main + resolved-ref: "6690e87f19e024d70b68efbc70d2159c34b5d0fc" + url: "git@github.com:linagora/linkfy_text.git" + source: git + version: "1.1.6" lints: dependency: transitive description: @@ -1875,8 +1876,8 @@ packages: dependency: "direct main" description: path: "." - ref: "twake-supported-0.22.6" - resolved-ref: "8435e632d7bce166085c6426fbfb4173457526f9" + ref: support-filter-for-request-history + resolved-ref: "3709e411df81a0d90cb1d868df4cd23e4d05d4dd" url: "git@github.com:linagora/matrix-dart-sdk.git" source: git version: "0.22.6" @@ -1885,7 +1886,7 @@ packages: description: path: "." ref: main - resolved-ref: a498051a8a7e41a35bde65f37c25add3f808b929 + resolved-ref: "9353b6d6b6c1b9cc9e9a9290ffd0c777c6a0b479" url: "https://github.com/linagora/dart_matrix_api_lite.git" source: git version: "1.7.4" @@ -2323,6 +2324,14 @@ packages: url: "https://pub.dev" source: hosted version: "1.5.1" + pretty_qr_code: + dependency: "direct main" + description: + name: pretty_qr_code + sha256: cbdb4af29da1c1fa21dd76f809646c591320ab9e435d3b0eab867492d43607d5 + url: "https://pub.dev" + source: hosted + version: "3.3.0" process: dependency: transitive description: @@ -2363,6 +2372,14 @@ packages: url: "https://pub.dev" source: hosted version: "1.2.3" + pull_down_button: + dependency: "direct main" + description: + name: pull_down_button + sha256: "12cdd8ff187a3150ebdf075e5074299f085579b158d2b4e655ccbafccf95f25b" + url: "https://pub.dev" + source: hosted + version: "0.10.2" punycode: dependency: "direct main" description: @@ -3385,4 +3402,4 @@ packages: version: "3.1.2" sdks: dart: ">=3.5.0-259.0.dev <4.0.0" - flutter: ">=3.19.0" + flutter: ">=3.19.3" From 557d2e883b8ab973af2249c473215625fab20396 Mon Sep 17 00:00:00 2001 From: HuyNguyen Date: Tue, 10 Dec 2024 14:34:31 +0700 Subject: [PATCH 4/5] fixup! fixup! fixup! TW-1862: Fix can't display message in chat --- lib/pages/chat/chat.dart | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/lib/pages/chat/chat.dart b/lib/pages/chat/chat.dart index 60fcca5257..e4a8c83925 100644 --- a/lib/pages/chat/chat.dart +++ b/lib/pages/chat/chat.dart @@ -1734,6 +1734,12 @@ class ChatController extends State _currentChatScrollState = ChatScrollState.scrolling; } + List get getEventTypeToFilterUnnecessaryEvent => [ + EventTypes.Message, + EventTypes.Encrypted, + EventTypes.Sticker, + ]; + Future _tryRequestHistory() async { if (timeline == null) return; @@ -1759,11 +1765,7 @@ class ChatController extends State historyCount: _defaultEventCountDisplay, filter: StateFilter( lazyLoadMembers: true, - types: [ - EventTypes.Message, - EventTypes.Encrypted, - EventTypes.Sticker, - ], + types: getEventTypeToFilterUnnecessaryEvent, ), ); } From ee0fd65d66849aa48a85c4471dfc72fcb32b9c2c Mon Sep 17 00:00:00 2001 From: HuyNguyen Date: Wed, 11 Dec 2024 16:48:13 +0700 Subject: [PATCH 5/5] fixup! fixup! fixup! fixup! TW-1862: Fix can't display message in chat --- pubspec.lock | 4 ++-- pubspec.yaml | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/pubspec.lock b/pubspec.lock index 830687ac50..b12731d705 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -1876,8 +1876,8 @@ packages: dependency: "direct main" description: path: "." - ref: support-filter-for-request-history - resolved-ref: "3709e411df81a0d90cb1d868df4cd23e4d05d4dd" + ref: "twake-supported-0.22.6" + resolved-ref: "04ec6f3b9ece8e64e031cbe5c6e8164dc2ec7f2d" url: "git@github.com:linagora/matrix-dart-sdk.git" source: git version: "0.22.6" diff --git a/pubspec.yaml b/pubspec.yaml index e6df5fec66..28f07cbd49 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -12,7 +12,7 @@ dependencies: matrix: git: url: git@github.com:linagora/matrix-dart-sdk.git - ref: support-filter-for-request-history + ref: twake-supported-0.22.6 receive_sharing_intent: git: