This repository was archived by the owner on Apr 26, 2024. It is now read-only.
File tree Expand file tree Collapse file tree 2 files changed +11
-3
lines changed Expand file tree Collapse file tree 2 files changed +11
-3
lines changed Original file line number Diff line number Diff line change
1
+ Fix bug in handling of typing events for appservices. Contributed by Nick @ Beeper (@fizzadar).
Original file line number Diff line number Diff line change @@ -489,16 +489,23 @@ async def get_new_events_as(
489
489
handler = self .get_typing_handler ()
490
490
491
491
events = []
492
- for room_id in handler ._room_serials .keys ():
493
- if handler ._room_serials [room_id ] <= from_key :
492
+
493
+ # Work on a copy of things here as these may change in the handler while
494
+ # waiting for the AS `is_interested_in_room` call to complete.
495
+ # Shallow copy is safe as no nested data is present.
496
+ latest_room_serial = handler ._latest_room_serial
497
+ room_serials = handler ._room_serials .copy ()
498
+
499
+ for room_id , serial in room_serials .items ():
500
+ if serial <= from_key :
494
501
continue
495
502
496
503
if not await service .is_interested_in_room (room_id , self ._main_store ):
497
504
continue
498
505
499
506
events .append (self ._make_event_for (room_id ))
500
507
501
- return events , handler . _latest_room_serial
508
+ return events , latest_room_serial
502
509
503
510
async def get_new_events (
504
511
self ,
You can’t perform that action at this time.
0 commit comments