mirror of
https://git.anonymousland.org/anonymousland/synapse.git
synced 2025-08-01 09:06:03 -04:00
Fix (final) Bugbear violations (#9838)
This commit is contained in:
parent
71f0623de9
commit
495b214f4f
23 changed files with 46 additions and 49 deletions
|
@ -156,8 +156,7 @@ class DeviceWorkerHandler(BaseHandler):
|
|||
# The user may have left the room
|
||||
# TODO: Check if they actually did or if we were just invited.
|
||||
if room_id not in room_ids:
|
||||
for key, event_id in current_state_ids.items():
|
||||
etype, state_key = key
|
||||
for etype, state_key in current_state_ids.keys():
|
||||
if etype != EventTypes.Member:
|
||||
continue
|
||||
possibly_left.add(state_key)
|
||||
|
@ -179,8 +178,7 @@ class DeviceWorkerHandler(BaseHandler):
|
|||
log_kv(
|
||||
{"event": "encountered empty previous state", "room_id": room_id}
|
||||
)
|
||||
for key, event_id in current_state_ids.items():
|
||||
etype, state_key = key
|
||||
for etype, state_key in current_state_ids.keys():
|
||||
if etype != EventTypes.Member:
|
||||
continue
|
||||
possibly_changed.add(state_key)
|
||||
|
@ -198,8 +196,7 @@ class DeviceWorkerHandler(BaseHandler):
|
|||
for state_dict in prev_state_ids.values():
|
||||
member_event = state_dict.get((EventTypes.Member, user_id), None)
|
||||
if not member_event or member_event != current_member_id:
|
||||
for key, event_id in current_state_ids.items():
|
||||
etype, state_key = key
|
||||
for etype, state_key in current_state_ids.keys():
|
||||
if etype != EventTypes.Member:
|
||||
continue
|
||||
possibly_changed.add(state_key)
|
||||
|
@ -714,7 +711,7 @@ class DeviceListUpdater:
|
|||
# This can happen since we batch updates
|
||||
return
|
||||
|
||||
for device_id, stream_id, prev_ids, content in pending_updates:
|
||||
for device_id, stream_id, prev_ids, _ in pending_updates:
|
||||
logger.debug(
|
||||
"Handling update %r/%r, ID: %r, prev: %r ",
|
||||
user_id,
|
||||
|
@ -740,7 +737,7 @@ class DeviceListUpdater:
|
|||
else:
|
||||
# Simply update the single device, since we know that is the only
|
||||
# change (because of the single prev_id matching the current cache)
|
||||
for device_id, stream_id, prev_ids, content in pending_updates:
|
||||
for device_id, stream_id, _, content in pending_updates:
|
||||
await self.store.update_remote_device_list_cache_entry(
|
||||
user_id, device_id, content, stream_id
|
||||
)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue