summary refs log tree commit diff
path: root/synapse/streams/config.py
diff options
context:
space:
mode:
authorOlivier Wilkinson (reivilibre) <olivier@librepush.net>2021-08-03 10:34:44 +0100
committerOlivier Wilkinson (reivilibre) <olivier@librepush.net>2021-08-03 10:34:44 +0100
commit11dda97e86579d807528392df7ba3c3efdd03c01 (patch)
tree003e6d55563e78ccca0e9f4a2b1c798231038370 /synapse/streams/config.py
parentMerge branch 'release-v1.39' of github.com:matrix-org/synapse into matrix-org... (diff)
parentFix the `tests-done` github actions step, again (#10512) (diff)
downloadsynapse-11dda97e86579d807528392df7ba3c3efdd03c01.tar.xz
Merge remote-tracking branch 'origin/develop' into matrix-org-hotfixes
Diffstat (limited to 'synapse/streams/config.py')
-rw-r--r--synapse/streams/config.py16
1 files changed, 9 insertions, 7 deletions
diff --git a/synapse/streams/config.py b/synapse/streams/config.py

index 13d300588b..cf4005984b 100644 --- a/synapse/streams/config.py +++ b/synapse/streams/config.py
@@ -47,20 +47,22 @@ class PaginationConfig: ) -> "PaginationConfig": direction = parse_string(request, "dir", default="f", allowed_values=["f", "b"]) - from_tok = parse_string(request, "from") - to_tok = parse_string(request, "to") + from_tok_str = parse_string(request, "from") + to_tok_str = parse_string(request, "to") try: - if from_tok == "END": + from_tok = None + if from_tok_str == "END": from_tok = None # For backwards compat. - elif from_tok: - from_tok = await StreamToken.from_string(store, from_tok) + elif from_tok_str: + from_tok = await StreamToken.from_string(store, from_tok_str) except Exception: raise SynapseError(400, "'from' parameter is invalid") try: - if to_tok: - to_tok = await StreamToken.from_string(store, to_tok) + to_tok = None + if to_tok_str: + to_tok = await StreamToken.from_string(store, to_tok_str) except Exception: raise SynapseError(400, "'to' parameter is invalid")