mirror of
https://git.anonymousland.org/anonymousland/synapse.git
synced 2025-08-07 21:52:36 -04:00
Various clean ups to room stream tokens. (#8423)
This commit is contained in:
parent
8238b55e08
commit
ea70f1c362
16 changed files with 96 additions and 76 deletions
|
@ -47,8 +47,8 @@ class PurgeTests(HomeserverTestCase):
|
|||
storage = self.hs.get_storage()
|
||||
|
||||
# Get the topological token
|
||||
event = self.get_success(
|
||||
store.get_topological_token_for_event(last["event_id"])
|
||||
event = str(
|
||||
self.get_success(store.get_topological_token_for_event(last["event_id"]))
|
||||
)
|
||||
|
||||
# Purge everything before this topological token
|
||||
|
@ -74,12 +74,10 @@ class PurgeTests(HomeserverTestCase):
|
|||
storage = self.hs.get_datastore()
|
||||
|
||||
# Set the topological token higher than it should be
|
||||
event = self.get_success(
|
||||
token = self.get_success(
|
||||
storage.get_topological_token_for_event(last["event_id"])
|
||||
)
|
||||
event = "t{}-{}".format(
|
||||
*list(map(lambda x: x + 1, map(int, event[1:].split("-"))))
|
||||
)
|
||||
event = "t{}-{}".format(token.topological + 1, token.stream + 1)
|
||||
|
||||
# Purge everything before this topological token
|
||||
purge = defer.ensureDeferred(storage.purge_history(self.room_id, event, True))
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue