Merge branch 'krille/fix-invite-state' into 'main'

fix: Room Member updates should always be cached

Closes #260

See merge request famedly/company/frontend/famedlysdk!932
This commit is contained in:
Krille Fear 2022-01-08 09:53:29 +00:00
commit d31a594068
4 changed files with 16 additions and 2 deletions

View File

@ -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 ## [0.7.1] - 08nd Dec 2021
- fix: fallback in body for replies to replies (Nicolas Werner) - 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) - 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)

View File

@ -1709,7 +1709,9 @@ class Client extends MatrixApi {
stateEvent.relationshipEventId == stateEvent.relationshipEventId ==
room.lastEvent?.relationshipEventId; room.lastEvent?.relationshipEventId;
final importantOrRoomLoaded = final importantOrRoomLoaded =
!room.partial || importantStateEvents.contains(stateEvent.type); eventUpdate.type == EventUpdateType.inviteState ||
!room.partial ||
importantStateEvents.contains(stateEvent.type);
if ((noMessageOrNoEdit || editingLastEvent || consecutiveEdit) && if ((noMessageOrNoEdit || editingLastEvent || consecutiveEdit) &&
importantOrRoomLoaded) { importantOrRoomLoaded) {
room.setState(stateEvent); room.setState(stateEvent);

View File

@ -1,6 +1,6 @@
name: matrix name: matrix
description: Matrix Dart SDK description: Matrix Dart SDK
version: 0.7.1 version: 0.7.2
homepage: https://famedly.com homepage: https://famedly.com
environment: environment:

View File

@ -141,6 +141,11 @@ void main() {
matrix.rooms[1].roomAccountData['m.receipt'] matrix.rooms[1].roomAccountData['m.receipt']
?.content['@alice:example.com']['event_id'], ?.content['@alice:example.com']['event_id'],
'7365636s6r6432:example.com'); '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.length, 2);
expect(matrix.rooms[1].canonicalAlias, expect(matrix.rooms[1].canonicalAlias,
"#famedlyContactDiscovery:${matrix.userID!.split(":")[1]}"); "#famedlyContactDiscovery:${matrix.userID!.split(":")[1]}");