Fix-up assertions about last stream token in push (#9020)

The last stream token is always known and we do not need to handle none.
This commit is contained in:
Patrick Cloke 2021-01-05 10:53:15 -05:00 committed by GitHub
parent 31b1905e13
commit 37eaf9c272
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 8 additions and 14 deletions

View file

@ -106,6 +106,10 @@ class PusherPool:
time_now_msec = self.clock.time_msec()
# create the pusher setting last_stream_ordering to the current maximum
# stream ordering, so it will process pushes from this point onwards.
last_stream_ordering = self.store.get_room_max_stream_ordering()
# we try to create the pusher just to validate the config: it
# will then get pulled out of the database,
# recreated, added and started: this means we have only one
@ -124,16 +128,12 @@ class PusherPool:
ts=time_now_msec,
lang=lang,
data=data,
last_stream_ordering=None,
last_stream_ordering=last_stream_ordering,
last_success=None,
failing_since=None,
)
)
# create the pusher setting last_stream_ordering to the current maximum
# stream ordering, so it will process pushes from this point onwards.
last_stream_ordering = self.store.get_room_max_stream_ordering()
await self.store.add_pusher(
user_id=user_id,
access_token=access_token,