diff options
author | Erik Johnston <erik@matrix.org> | 2018-05-09 15:31:33 +0100 |
---|---|---|
committer | Erik Johnston <erik@matrix.org> | 2018-05-09 15:31:33 +0100 |
commit | 9896dab8f6cbdf1cdac4549e20e4ed0ba17d5655 (patch) | |
tree | e288da53414d96fc48ea02e38aa33a4b449c31da /synapse | |
parent | Refactor get_recent_events_for_room return type (diff) | |
parent | Merge pull request #3196 from matrix-org/erikj/pagination_return (diff) | |
download | synapse-9896dab8f6cbdf1cdac4549e20e4ed0ba17d5655.tar.xz |
Merge branch 'develop' of github.com:matrix-org/synapse into erikj/fixup_return_pagination
Diffstat (limited to 'synapse')
-rw-r--r-- | synapse/metrics/metric.py | 5 | ||||
-rw-r--r-- | synapse/rest/client/v2_alpha/notifications.py | 2 | ||||
-rw-r--r-- | synapse/storage/stream.py | 11 |
3 files changed, 10 insertions, 8 deletions
diff --git a/synapse/metrics/metric.py b/synapse/metrics/metric.py index fbba94e633..f421e7a93f 100644 --- a/synapse/metrics/metric.py +++ b/synapse/metrics/metric.py @@ -71,7 +71,8 @@ class BaseMetric(object): """Render this metric for a single set of labels Args: - label_values (list[str]): values for each of the labels + label_values (list[object]): values for each of the labels, + (which get stringified). value: value of the metric at with these labels Returns: @@ -324,4 +325,4 @@ def _escape_character(m): def _escape_label_value(value): """Takes a label value and escapes quotes, newlines and backslashes """ - return re.sub(r"([\n\"\\])", _escape_character, value) + return re.sub(r"([\n\"\\])", _escape_character, str(value)) diff --git a/synapse/rest/client/v2_alpha/notifications.py b/synapse/rest/client/v2_alpha/notifications.py index ec170109fe..66583d6778 100644 --- a/synapse/rest/client/v2_alpha/notifications.py +++ b/synapse/rest/client/v2_alpha/notifications.py @@ -88,7 +88,7 @@ class NotificationsServlet(RestServlet): pa["topological_ordering"], pa["stream_ordering"] ) returned_push_actions.append(returned_pa) - next_token = pa["stream_ordering"] + next_token = str(pa["stream_ordering"]) defer.returnValue((200, { "notifications": returned_push_actions, diff --git a/synapse/storage/stream.py b/synapse/storage/stream.py index b5baacd32c..f529642101 100644 --- a/synapse/storage/stream.py +++ b/synapse/storage/stream.py @@ -399,7 +399,7 @@ class StreamWorkerStore(EventsWorkerStore, SQLBaseStore): Returns: Deferred[tuple[list[_EventDictReturn], str]]: Returns a list of - _EventDictReturn and a token pointint to the start of the returned + _EventDictReturn and a token pointing to the start of the returned events. The events returned are in ascending order. """ @@ -528,7 +528,8 @@ class StreamWorkerStore(EventsWorkerStore, SQLBaseStore): events (list[FrozenEvent]) rows (list[_EventDictReturn]) topo_order (bool): Whether the events were ordered topologically - or by stream ordering + or by stream ordering. If true then all rows should have a non + null topological_ordering. """ for event, row in zip(events, rows): stream = row.stream_ordering @@ -706,9 +707,9 @@ class StreamWorkerStore(EventsWorkerStore, SQLBaseStore): those that match the filter. Returns: - tuple[list[_EventDictReturn], str]: Returns the results as a list - of _EventDictReturn and a token that points to the end of the - result set. + Deferred[tuple[list[_EventDictReturn], str]]: Returns the results + as a list of _EventDictReturn and a token that points to the end + of the result set. """ # Tokens really represent positions between elements, but we use # the convention of pointing to the event before the gap. Hence |