0
0
Fork 1
mirror of https://mau.dev/maunium/synapse.git synced 2024-11-18 16:02:15 +01:00

Assume key existence. Update docstrings

This commit is contained in:
Erik Johnston 2019-07-05 14:07:56 +01:00
parent c061d4f237
commit 9ccea16d45
2 changed files with 11 additions and 9 deletions

View file

@ -209,9 +209,7 @@ class AdminHandler(BaseHandler):
# Now check if this event is an unseen prev event, if so # Now check if this event is an unseen prev event, if so
# then we remove this event from the appropriate dicts. # then we remove this event from the appropriate dicts.
for child_id in unseen_to_child_events.pop(event.event_id, []): for child_id in unseen_to_child_events.pop(event.event_id, []):
event_to_unseen_prevs.get(child_id, set()).discard( event_to_unseen_prevs[child_id].discard(event.event_id)
event.event_id
)
written_events.add(event.event_id) written_events.add(event.event_id)

View file

@ -833,7 +833,9 @@ class StreamWorkerStore(EventsWorkerStore, SQLBaseStore):
Returns: Returns:
Deferred[tuple[list[_EventDictReturn], str]]: Returns the results Deferred[tuple[list[_EventDictReturn], str]]: Returns the results
as a list of _EventDictReturn and a token that points to the end as a list of _EventDictReturn and a token that points to the end
of the result set. of the result set. If no events are returned then the end of the
stream has been reached (i.e. there are no events between
`from_token` and `to_token`).
""" """
assert int(limit) >= 0 assert int(limit) >= 0
@ -905,15 +907,17 @@ class StreamWorkerStore(EventsWorkerStore, SQLBaseStore):
only those before only those before
direction(char): Either 'b' or 'f' to indicate whether we are direction(char): Either 'b' or 'f' to indicate whether we are
paginating forwards or backwards from `from_key`. paginating forwards or backwards from `from_key`.
limit (int): The maximum number of events to return. Zero or less limit (int): The maximum number of events to return.
means no limit.
event_filter (Filter|None): If provided filters the events to event_filter (Filter|None): If provided filters the events to
those that match the filter. those that match the filter.
Returns: Returns:
tuple[list[dict], str]: Returns the results as a list of dicts and tuple[list[FrozenEvents], str]: Returns the results as a list of
a token that points to the end of the result set. The dicts have dicts and a token that points to the end of the result set. The
the keys "event_id", "topological_ordering" and "stream_orderign". dicts have the keys "event_id", "topological_ordering" and
"stream_ordering". If no events are returned then the end of the
stream has been reached (i.e. there are no events between
`from_key` and `to_key`).
""" """
from_key = RoomStreamToken.parse(from_key) from_key = RoomStreamToken.parse(from_key)