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

Commit

Permalink
Set min application service stream_id to 1
Browse files Browse the repository at this point in the history
Factored out into #12193.
  • Loading branch information
anoadragon453 committed Mar 9, 2022
1 parent 87c230c commit 4b67118
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion synapse/storage/databases/main/appservice.py
Original file line number Diff line number Diff line change
Expand Up @@ -446,7 +446,7 @@ def get_type_stream_id_for_appservice_txn(txn):
)
last_stream_id = txn.fetchone()
if last_stream_id is None or last_stream_id[0] is None: # no row exists
return 0
return 1
else:
return int(last_stream_id[0])

Expand Down
4 changes: 2 additions & 2 deletions tests/storage/test_appservice.py
Original file line number Diff line number Diff line change
Expand Up @@ -476,12 +476,12 @@ def test_get_type_stream_id_for_appservice_no_value(self) -> None:
value = self.get_success(
self.store.get_type_stream_id_for_appservice(self.service, "read_receipt")
)
self.assertEqual(value, 0)
self.assertEqual(value, 1)

value = self.get_success(
self.store.get_type_stream_id_for_appservice(self.service, "presence")
)
self.assertEqual(value, 0)
self.assertEqual(value, 1)

def test_get_type_stream_id_for_appservice_invalid_type(self) -> None:
self.get_failure(
Expand Down

0 comments on commit 4b67118

Please sign in to comment.