You've already forked matrix-js-sdk
mirror of
https://github.com/matrix-org/matrix-js-sdk.git
synced 2025-12-04 05:02:41 +03:00
Fix threads reply count sometimes off by one (#2240)
This commit is contained in:
@@ -191,7 +191,10 @@ export class Thread extends TypedEventEmitter<EmittedEvents, EventHandlerMap> {
|
|||||||
// There is a risk that the `localTimestamp` approximation will not be accurate
|
// There is a risk that the `localTimestamp` approximation will not be accurate
|
||||||
// when threads are used over federation. That could results in the reply
|
// when threads are used over federation. That could results in the reply
|
||||||
// count value drifting away from the value returned by the server
|
// 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;
|
this.lastEvent = event;
|
||||||
if (this.lastEvent.getId() !== this.id) {
|
if (this.lastEvent.getId() !== this.id) {
|
||||||
// This counting only works when server side support is enabled
|
// This counting only works when server side support is enabled
|
||||||
|
|||||||
Reference in New Issue
Block a user