mirror of
https://mau.dev/maunium/synapse.git
synced 2024-12-14 05:33:46 +01:00
Support clients supplying older tokens, fix short poll test
This commit is contained in:
parent
79b65f3875
commit
fb46937413
2 changed files with 3 additions and 3 deletions
|
@ -112,7 +112,7 @@ class StreamToken(
|
||||||
def from_string(cls, string):
|
def from_string(cls, string):
|
||||||
try:
|
try:
|
||||||
keys = string.split(cls._SEPARATOR)
|
keys = string.split(cls._SEPARATOR)
|
||||||
if len(keys) == len(cls._fields) - 1:
|
while len(keys) < len(cls._fields):
|
||||||
# i.e. old token from before receipt_key
|
# i.e. old token from before receipt_key
|
||||||
keys.append("0")
|
keys.append("0")
|
||||||
return cls(*keys)
|
return cls(*keys)
|
||||||
|
|
|
@ -369,7 +369,7 @@ class PresenceEventStreamTestCase(unittest.TestCase):
|
||||||
# all be ours
|
# all be ours
|
||||||
|
|
||||||
# I'll already get my own presence state change
|
# I'll already get my own presence state change
|
||||||
self.assertEquals({"start": "0_1_0_0", "end": "0_1_0_0", "chunk": []},
|
self.assertEquals({"start": "0_1_0_0_0", "end": "0_1_0_0_0", "chunk": []},
|
||||||
response
|
response
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@ -388,7 +388,7 @@ class PresenceEventStreamTestCase(unittest.TestCase):
|
||||||
"/events?from=s0_1_0&timeout=0", None)
|
"/events?from=s0_1_0&timeout=0", None)
|
||||||
|
|
||||||
self.assertEquals(200, code)
|
self.assertEquals(200, code)
|
||||||
self.assertEquals({"start": "s0_1_0_0", "end": "s0_2_0_0", "chunk": [
|
self.assertEquals({"start": "s0_1_0_0_0", "end": "s0_2_0_0_0", "chunk": [
|
||||||
{"type": "m.presence",
|
{"type": "m.presence",
|
||||||
"content": {
|
"content": {
|
||||||
"user_id": "@banana:test",
|
"user_id": "@banana:test",
|
||||||
|
|
Loading…
Reference in a new issue