mirror of
https://git.anonymousland.org/anonymousland/synapse.git
synced 2025-12-11 12:50:52 -05:00
Make token serializing/deserializing async (#8427)
The idea is that in future tokens will encode a mapping of instance to position. However, we don't want to include the full instance name in the string representation, so instead we'll have a mapping between instance name and an immutable integer ID in the DB that we can use instead. We'll then do the lookup when we serialize/deserialize the token (we could alternatively pass around an `Instance` type that includes both the name and ID, but that turns out to be a lot more invasive).
This commit is contained in:
parent
a0a1ba6973
commit
7941372ec8
17 changed files with 115 additions and 59 deletions
|
|
@ -47,12 +47,15 @@ class PurgeTests(HomeserverTestCase):
|
|||
storage = self.hs.get_storage()
|
||||
|
||||
# Get the topological token
|
||||
event = str(
|
||||
self.get_success(store.get_topological_token_for_event(last["event_id"]))
|
||||
token = self.get_success(
|
||||
store.get_topological_token_for_event(last["event_id"])
|
||||
)
|
||||
token_str = self.get_success(token.to_string(self.hs.get_datastore()))
|
||||
|
||||
# Purge everything before this topological token
|
||||
self.get_success(storage.purge_events.purge_history(self.room_id, event, True))
|
||||
self.get_success(
|
||||
storage.purge_events.purge_history(self.room_id, token_str, True)
|
||||
)
|
||||
|
||||
# 1-3 should fail and last will succeed, meaning that 1-3 are deleted
|
||||
# and last is not.
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue