Skip to content

Commit 03fc12e

Browse files
authored
Merge pull request #1492 from matrix-org/t3chguy/fix/10545
Fix editing local echoes not updating them in real time
2 parents d7ef128 + 8ec3b88 commit 03fc12e

File tree

3 files changed

+16
-2
lines changed

3 files changed

+16
-2
lines changed

spec/browserify/sync-browserify.spec.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -99,5 +99,5 @@ describe("Browserify Test", function() {
9999
client.once("sync.unexpectedError", reject);
100100
}),
101101
]);
102-
}, 10000);
102+
}, 20000); // additional timeout as this test can take quite a while
103103
});

src/models/event-timeline-set.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -806,7 +806,7 @@ EventTimelineSet.prototype.aggregateRelations = function(event) {
806806
this.room,
807807
);
808808
isNewRelations = true;
809-
relatesToEvent = this.findEventById(relatesToEventId);
809+
relatesToEvent = this.findEventById(relatesToEventId) || this.room.getPendingEvent(relatesToEventId);
810810
if (relatesToEvent) {
811811
relationsWithEventType.setTargetEvent(relatesToEvent);
812812
}

src/models/room.js

+14
Original file line numberDiff line numberDiff line change
@@ -373,6 +373,20 @@ Room.prototype.hasPendingEvent = function(eventId) {
373373
return this._pendingEventList.some(event => event.getId() === eventId);
374374
};
375375

376+
/**
377+
* Get a specific event from the pending event list, if configured, null otherwise.
378+
*
379+
* @param {string} eventId The event ID to check for.
380+
* @return {MatrixEvent}
381+
*/
382+
Room.prototype.getPendingEvent = function(eventId) {
383+
if (this._opts.pendingEventOrdering !== "detached") {
384+
return null;
385+
}
386+
387+
return this._pendingEventList.find(event => event.getId() === eventId);
388+
};
389+
376390
/**
377391
* Get the live unfiltered timeline for this room.
378392
*

0 commit comments

Comments
 (0)