This repository was archived by the owner on Apr 26, 2024. It is now read-only.
File tree Expand file tree Collapse file tree 5 files changed +108
-77
lines changed Expand file tree Collapse file tree 5 files changed +108
-77
lines changed Original file line number Diff line number Diff line change
1
+ Add missing type hints to storage classes.
Original file line number Diff line number Diff line change @@ -37,7 +37,6 @@ exclude = (?x)
37
37
|synapse/storage/databases/main/purge_events.py
38
38
|synapse/storage/databases/main/push_rule.py
39
39
|synapse/storage/databases/main/receipts.py
40
- |synapse/storage/databases/main/room.py
41
40
|synapse/storage/databases/main/roommember.py
42
41
|synapse/storage/databases/main/search.py
43
42
|synapse/storage/databases/main/state.py
@@ -205,6 +204,9 @@ disallow_untyped_defs = True
205
204
[mypy-synapse.storage.databases.main.events_worker]
206
205
disallow_untyped_defs = True
207
206
207
+ [mypy-synapse.storage.databases.main.room]
208
+ disallow_untyped_defs = True
209
+
208
210
[mypy-synapse.storage.databases.main.room_batch]
209
211
disallow_untyped_defs = True
210
212
Original file line number Diff line number Diff line change @@ -1020,7 +1020,7 @@ async def transfer_room_state_on_room_upgrade(
1020
1020
# Add new room to the room directory if the old room was there
1021
1021
# Remove old room from the room directory
1022
1022
old_room = await self .store .get_room (old_room_id )
1023
- if old_room and old_room ["is_public" ]:
1023
+ if old_room is not None and old_room ["is_public" ]:
1024
1024
await self .store .set_room_is_public (old_room_id , False )
1025
1025
await self .store .set_room_is_public (room_id , True )
1026
1026
@@ -1031,7 +1031,9 @@ async def transfer_room_state_on_room_upgrade(
1031
1031
local_group_ids = await self .store .get_local_groups_for_room (old_room_id )
1032
1032
for group_id in local_group_ids :
1033
1033
# Add new the new room to those groups
1034
- await self .store .add_room_to_group (group_id , room_id , old_room ["is_public" ])
1034
+ await self .store .add_room_to_group (
1035
+ group_id , room_id , old_room is not None and old_room ["is_public" ]
1036
+ )
1035
1037
1036
1038
# Remove the old room from those groups
1037
1039
await self .store .remove_room_from_group (group_id , old_room_id )
Original file line number Diff line number Diff line change @@ -149,7 +149,6 @@ def __init__(
149
149
],
150
150
)
151
151
152
- self ._event_reports_id_gen = IdGenerator (db_conn , "event_reports" , "id" )
153
152
self ._push_rule_id_gen = IdGenerator (db_conn , "push_rules" , "id" )
154
153
self ._push_rules_enable_id_gen = IdGenerator (db_conn , "push_rules_enable" , "id" )
155
154
self ._group_updates_id_gen = StreamIdGenerator (
You can’t perform that action at this time.
0 commit comments