Skip to content

Commit

Permalink
Clarify docs for some room state functions (#16950)
Browse files Browse the repository at this point in the history
State *before* an event is different to state *after* that event, and
people tend to assume the wrong one.
  • Loading branch information
richvdh authored Mar 19, 2024
1 parent 42fa47a commit 9635822
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
1 change: 1 addition & 0 deletions changelog.d/16950.misc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Clarify docs for some room state functions.
8 changes: 5 additions & 3 deletions synapse/storage/controllers/state.py
Original file line number Diff line number Diff line change
Expand Up @@ -273,8 +273,10 @@ async def get_state_ids_for_events(
await_full_state: bool = True,
) -> Dict[str, StateMap[str]]:
"""
Get the state dicts corresponding to a list of events, containing the event_ids
of the state events (as opposed to the events themselves)
Get the room states after each of a list of events.
For each event in `event_ids`, the result contains a map from state tuple
to the event_ids of the state event (as opposed to the events themselves).
Args:
event_ids: events whose state should be returned
Expand Down Expand Up @@ -347,7 +349,7 @@ async def get_state_ids_for_event(
await_full_state: bool = True,
) -> StateMap[str]:
"""
Get the state dict corresponding to a particular event
Get the state dict corresponding to the state after a particular event
Args:
event_id: event whose state should be returned
Expand Down

0 comments on commit 9635822

Please sign in to comment.