diff --git a/src/models/thread.ts b/src/models/thread.ts index d2ccefbc1..7d735a915 100644 --- a/src/models/thread.ts +++ b/src/models/thread.ts @@ -191,7 +191,10 @@ export class Thread extends TypedEventEmitter { // There is a risk that the `localTimestamp` approximation will not be accurate // when threads are used over federation. That could results in the reply // count value drifting away from the value returned by the server - if (!this.lastEvent || (isThreadReply && event.localTimestamp > this.lastEvent.localTimestamp)) { + if (!this.lastEvent || (isThreadReply + && (event.getId() !== this.lastEvent.getId()) + && (event.localTimestamp > this.lastEvent.localTimestamp)) + ) { this.lastEvent = event; if (this.lastEvent.getId() !== this.id) { // This counting only works when server side support is enabled