From b472dd7b92d3ceb22f7ae2dc4d018e0dafbe5262 Mon Sep 17 00:00:00 2001 From: Krille Fear Date: Sat, 8 Jan 2022 10:24:40 +0100 Subject: [PATCH 1/2] fix: Room Member updates should always be cached I think the commit which broke it was this: e3bd0cf1 It makes sure that only important state events get cached and room member events are not important state events and so new invites have no room member events cached. It makes sense to also allow room member events here to always be cached as they are special typed. --- lib/src/client.dart | 4 +++- test/client_test.dart | 5 +++++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/lib/src/client.dart b/lib/src/client.dart index 9503adc1..534875ae 100644 --- a/lib/src/client.dart +++ b/lib/src/client.dart @@ -1709,7 +1709,9 @@ class Client extends MatrixApi { stateEvent.relationshipEventId == room.lastEvent?.relationshipEventId; final importantOrRoomLoaded = - !room.partial || importantStateEvents.contains(stateEvent.type); + eventUpdate.type == EventUpdateType.inviteState || + !room.partial || + importantStateEvents.contains(stateEvent.type); if ((noMessageOrNoEdit || editingLastEvent || consecutiveEdit) && importantOrRoomLoaded) { room.setState(stateEvent); diff --git a/test/client_test.dart b/test/client_test.dart index f480b1e4..81162794 100644 --- a/test/client_test.dart +++ b/test/client_test.dart @@ -141,6 +141,11 @@ void main() { matrix.rooms[1].roomAccountData['m.receipt'] ?.content['@alice:example.com']['event_id'], '7365636s6r6432:example.com'); + + final inviteRoom = matrix.rooms + .singleWhere((room) => room.membership == Membership.invite); + expect(inviteRoom.name, 'My Room Name'); + expect(inviteRoom.states[EventTypes.RoomMember]?.length, 1); expect(matrix.rooms.length, 2); expect(matrix.rooms[1].canonicalAlias, "#famedlyContactDiscovery:${matrix.userID!.split(":")[1]}"); From 86c9067daab1ccb3e21ae893bc6785c45885830b Mon Sep 17 00:00:00 2001 From: Krille Fear Date: Sat, 8 Jan 2022 10:47:14 +0100 Subject: [PATCH 2/2] chore: Bump version --- CHANGELOG.md | 7 +++++++ pubspec.yaml | 2 +- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 5f91d7ea..109168bd 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,10 @@ +## [0.7.2] - 08nd Jan 2022 +- feat: Let sendDefaultMessage return false on encryption failure (Krille Fear) +- fix: Room Member updates should always be cached (Krille Fear) +- fix: Requested users are not stored (Christian Pauly) +- fix: Localize reactions (Krille Fear) +- refactor: Remove unnecessary type checks and imports (Krille Fear) + ## [0.7.1] - 08nd Dec 2021 - fix: fallback in body for replies to replies (Nicolas Werner) - fix: ignore 4xx errors when re-sending the to_device queue The to_device queue was introduced to ensure integrity if e.g. the server temporarily failed when attempting to send a to_device message. If, for whatever reason, the server responds with a 4xx error, though, then we want to ignore that to_device message from the queue and move on, as that means that something different was fundamentally wrong. This helps to fix the to_device queue clogging up, making clients incapable of sending to_device events anymore, should such clogging happen. (Sorunome) diff --git a/pubspec.yaml b/pubspec.yaml index 5c5b91f6..e371f768 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -1,6 +1,6 @@ name: matrix description: Matrix Dart SDK -version: 0.7.1 +version: 0.7.2 homepage: https://famedly.com environment: