mirror of
https://git.anonymousland.org/anonymousland/synapse.git
synced 2025-05-05 10:24:56 -04:00
Bugbear: Add Mutable Parameter fixes (#9682)
Part of #9366 Adds in fixes for B006 and B008, both relating to mutable parameter lint errors. Signed-off-by: Jonathan de Jong <jonathan@automatia.nl>
This commit is contained in:
parent
64f4f506c5
commit
2ca4e349e9
38 changed files with 224 additions and 113 deletions
|
@ -548,7 +548,7 @@ class SyncHandler:
|
|||
)
|
||||
|
||||
async def get_state_after_event(
|
||||
self, event: EventBase, state_filter: StateFilter = StateFilter.all()
|
||||
self, event: EventBase, state_filter: Optional[StateFilter] = None
|
||||
) -> StateMap[str]:
|
||||
"""
|
||||
Get the room state after the given event
|
||||
|
@ -558,7 +558,7 @@ class SyncHandler:
|
|||
state_filter: The state filter used to fetch state from the database.
|
||||
"""
|
||||
state_ids = await self.state_store.get_state_ids_for_event(
|
||||
event.event_id, state_filter=state_filter
|
||||
event.event_id, state_filter=state_filter or StateFilter.all()
|
||||
)
|
||||
if event.is_state():
|
||||
state_ids = dict(state_ids)
|
||||
|
@ -569,7 +569,7 @@ class SyncHandler:
|
|||
self,
|
||||
room_id: str,
|
||||
stream_position: StreamToken,
|
||||
state_filter: StateFilter = StateFilter.all(),
|
||||
state_filter: Optional[StateFilter] = None,
|
||||
) -> StateMap[str]:
|
||||
"""Get the room state at a particular stream position
|
||||
|
||||
|
@ -589,7 +589,7 @@ class SyncHandler:
|
|||
if last_events:
|
||||
last_event = last_events[-1]
|
||||
state = await self.get_state_after_event(
|
||||
last_event, state_filter=state_filter
|
||||
last_event, state_filter=state_filter or StateFilter.all()
|
||||
)
|
||||
|
||||
else:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue