plugin XEP-0384: Fix reentrancy loop:
When `prepare_for_profile` is called during connection init, an infinite loop could happen with 'get_session_manager` calling `prepare_for_profile`. A check is added to early exit if the profile is already being prepared, avoiding this issue.
This commit is contained in:
parent
b4f41fe4a5
commit
ee4c80e4d1
1 changed files with 7 additions and 0 deletions
|
|
@ -2702,6 +2702,13 @@ class OMEMO:
|
|||
@param items_event: The event.
|
||||
@param profile: The profile this event belongs to.
|
||||
"""
|
||||
# Skip if session manager is already being built to prevent reentrancy loop
|
||||
# (device list refresh during init triggers this handler again)
|
||||
if profile in self.__session_manager_waiters:
|
||||
log.debug(
|
||||
f"Ignoring device list update for {profile} (session manager being built)"
|
||||
)
|
||||
return
|
||||
|
||||
sender = cast(jid.JID, items_event.sender)
|
||||
items = cast(List[domish.Element], items_event.items)
|
||||
|
|
|
|||
Loading…
Reference in a new issue