Merge pull request #1233 from vector-im/feature/fix_local_echo_no_update

Fix / sending event not always updating
This commit is contained in:
Benoit Marty 2020-04-15 16:51:16 +02:00 committed by GitHub
commit 1981d2e9ac
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 7 additions and 3 deletions

View File

@ -28,6 +28,7 @@ Bugfix 🐛:
- Cross- Signing | After signin in new session, verification paper trail in DM is off (#1191)
- Failed to encrypt message in room (message stays in red), [thanks to pwr22] (#925)
- Cross-Signing | web <-> riotX After QR code scan, gossiping fails (#1210)
- Local echo are not updated in timeline (for failed & encrypted states)
Translations 🗣:
-

View File

@ -171,10 +171,13 @@ internal class DefaultTimeline(
val realm = Realm.getInstance(realmConfiguration)
backgroundRealm.set(realm)
roomEntity = RoomEntity.where(realm, roomId = roomId).findFirst()?.also {
it.sendingTimelineEvents.addChangeListener { _ ->
postSnapshot()
roomEntity = RoomEntity.where(realm, roomId = roomId).findFirst()
roomEntity?.sendingTimelineEvents?.addChangeListener { events ->
// Remove in memory as soon as they are known by database
events.forEach { te ->
inMemorySendingEvents.removeAll { te.eventId == it.eventId }
}
postSnapshot()
}
nonFilteredEvents = buildEventQuery(realm).sort(TimelineEventEntityFields.DISPLAY_INDEX, Sort.DESCENDING).findAll()