Skip to content
This repository has been archived by the owner on Apr 26, 2024. It is now read-only.

Commit

Permalink
Fix the context complaint differently
Browse files Browse the repository at this point in the history
  • Loading branch information
David Robertson committed Jun 14, 2022
1 parent 1569b14 commit 134d3da
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion synapse/storage/databases/main/devices.py
Original file line number Diff line number Diff line change
Expand Up @@ -1865,6 +1865,8 @@ async def add_device_list_outbound_pokes(
Marks the associated row in `device_lists_changes_in_room` as handled.
"""
if context is None:
context = {}

def add_device_list_outbound_pokes_txn(
txn: LoggingTransaction, stream_ids: List[int]
Expand All @@ -1876,7 +1878,9 @@ def add_device_list_outbound_pokes_txn(
device_ids=[device_id],
hosts=hosts,
stream_ids=stream_ids,
context=context,
# mypy doesn't know that `context` is never None here, see
# https://mypy.readthedocs.io/en/stable/common_issues.html#narrowing-and-inner-functions
context=context, # type: ignore[arg-type]
)

self.db_pool.simple_update_txn(
Expand Down

0 comments on commit 134d3da

Please sign in to comment.