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

Commit

Permalink
Lint
Browse files Browse the repository at this point in the history
  • Loading branch information
babolivier committed Aug 11, 2020
1 parent d7a4589 commit 8246719
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
4 changes: 2 additions & 2 deletions synapse/handlers/sync.py
Original file line number Diff line number Diff line change
Expand Up @@ -936,7 +936,7 @@ async def compute_state_delta(

async def unread_notifs_for_room_id(
self, room_id: str, sync_config: SyncConfig
) -> Optional[Dict[str, str]]:
) -> Optional[Dict[str, int]]:
with Measure(self.clock, "unread_notifs_for_room_id"):
last_unread_event_id = await self.store.get_last_receipt_event_id_for_user(
user_id=sync_config.user.to_string(),
Expand Down Expand Up @@ -1886,7 +1886,7 @@ async def _generate_room_entry(
)

if room_builder.rtype == "joined":
unread_notifications = {} # type: Dict[str, str]
unread_notifications = {} # type: Dict[str, int]
room_sync = JoinedSyncResult(
room_id=room_id,
timeline=batch,
Expand Down
8 changes: 4 additions & 4 deletions synapse/storage/databases/main/event_push_actions.py
Original file line number Diff line number Diff line change
Expand Up @@ -228,8 +228,7 @@ def _get_count_from_push_actions_txn(
)

txn.execute(
sql % push_actions_column,
(user_id, room_id, stream_ordering),
sql % push_actions_column, (user_id, room_id, stream_ordering),
)
row = txn.fetchone()
count = row[0] if row else 0
Expand All @@ -239,7 +238,8 @@ def _get_count_from_push_actions_txn(
"""
SELECT %s FROM event_push_summary
WHERE room_id = ? AND user_id = ? AND stream_ordering > ?
""" % push_summary_column,
"""
% push_summary_column,
(room_id, user_id, stream_ordering),
)
rows = txn.fetchall()
Expand Down Expand Up @@ -980,7 +980,7 @@ def _rotate_notifs_before_txn(self, txn, rotate_to_stream_ordering):
txn.executemany(
"""
UPDATE event_push_summary
SET notif_count = ?, unread_count = ?, stream_ordering = ?
SET notif_count = ?, unread_count = ?, stream_ordering = ?
WHERE user_id = ? AND room_id = ?
""",
(
Expand Down
2 changes: 1 addition & 1 deletion tests/rest/client/v2_alpha/test_sync.py
Original file line number Diff line number Diff line change
Expand Up @@ -477,4 +477,4 @@ def _check_unread_count(self, expected_count: True):
)

# Store the next batch for the next request.
self.next_batch = channel.json_body["next_batch"]
self.next_batch = channel.json_body["next_batch"]

0 comments on commit 8246719

Please sign in to comment.