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(
489489 handler = self .get_typing_handler ()
490490
491491 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 :
494501 continue
495502
496503 if not await service .is_interested_in_room (room_id , self ._main_store ):
497504 continue
498505
499506 events .append (self ._make_event_for (room_id ))
500507
501- return events , handler . _latest_room_serial
508+ return events , latest_room_serial
502509
503510 async def get_new_events (
504511 self ,
You can’t perform that action at this time.
0 commit comments