Skip to content
This repository was archived by the owner on Apr 26, 2024. It is now read-only.

Commit 289faf1

Browse files
committed
Update comment docs
1 parent 9f902da commit 289faf1

File tree

2 files changed

+39
-36
lines changed

2 files changed

+39
-36
lines changed

synapse/handlers/message.py

Lines changed: 18 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -530,13 +530,12 @@ async def create_event(
530530
531531
state_event_ids:
532532
The full state at a given event. This is used particularly by the MSC2716
533-
/batch_send endpoint which shares the same state across the whole batch.
534-
The state events will be stripped down to only what's necessary to auth
535-
a given event and set as the auth_event_ids. For insertion events, we will
536-
add all of these state events as the explicit state so the rest of the
537-
historical batch can inherit the same state and state_group. This should
538-
normally be left as None, which will cause the auth_event_ids to be
539-
calculated based on the room state at the prev_events.
533+
/batch_send endpoint. One use case is with insertion events which float at
534+
the beginning of a historical batch and don't have any `prev_events` to
535+
derive from; we add all of these state events as the explicit state so the
536+
rest of the historical batch can inherit the same state and state_group.
537+
This should normally be left as None, which will cause the auth_event_ids
538+
to be calculated based on the room state at the prev_events.
540539
541540
require_consent: Whether to check if the requester has
542541
consented to the privacy policy.
@@ -822,13 +821,12 @@ async def create_and_send_nonmember_event(
822821
If non-None, prev_event_ids must also be provided.
823822
state_event_ids:
824823
The full state at a given event. This is used particularly by the MSC2716
825-
/batch_send endpoint which shares the same state across the whole batch.
826-
The state events will be stripped down to only what's necessary to auth
827-
a given event and set as the auth_event_ids. For insertion events, we will
828-
add all of these state events as the explicit state so the rest of the
829-
historical batch can inherit the same state and state_group. This should
830-
normally be left as None, which will cause the auth_event_ids to be
831-
calculated based on the room state at the prev_events.
824+
/batch_send endpoint. One use case is with insertion events which float at
825+
the beginning of a historical batch and don't have any `prev_events` to
826+
derive from; we add all of these state events as the explicit state so the
827+
rest of the historical batch can inherit the same state and state_group.
828+
This should normally be left as None, which will cause the auth_event_ids
829+
to be calculated based on the room state at the prev_events.
832830
ratelimit: Whether to rate limit this send.
833831
txn_id: The transaction ID.
834832
ignore_shadow_ban: True if shadow-banned users should be allowed to
@@ -948,13 +946,12 @@ async def create_new_client_event(
948946
949947
state_event_ids:
950948
The full state at a given event. This is used particularly by the MSC2716
951-
/batch_send endpoint which shares the same state across the whole batch.
952-
The state events will be stripped down to only what's necessary to auth
953-
a given event and set as the auth_event_ids. For insertion events, we will
954-
add all of these state events as the explicit state so the rest of the
955-
historical batch can inherit the same state and state_group. This should
956-
normally be left as None, which will cause the auth_event_ids to be
957-
calculated based on the room state at the prev_events.
949+
/batch_send endpoint. One use case is with insertion events which float at
950+
the beginning of a historical batch and don't have any `prev_events` to
951+
derive from; we add all of these state events as the explicit state so the
952+
rest of the historical batch can inherit the same state and state_group.
953+
This should normally be left as None, which will cause the auth_event_ids
954+
to be calculated based on the room state at the prev_events.
958955
959956
depth: Override the depth used to order the event in the DAG.
960957
Should normally be set to None, which will cause the depth to be calculated

synapse/handlers/room_member.py

Lines changed: 21 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -300,11 +300,13 @@ async def _local_membership_update(
300300
Should normally be left as None, which will cause them to be calculated
301301
based on the room state at the prev_events.
302302
state_event_ids:
303-
The full state at a given event. The state events will be stripped down to
304-
only what's necessary to auth the given event and set as the auth_event_ids.
305-
This is particularly used by the MSC2716 /batch_send endpoint. This should
306-
normally be left as None, which will cause the auth_event_ids to be
307-
calculated based on the room state at the prev_events.
303+
The full state at a given event. This is used particularly by the MSC2716
304+
/batch_send endpoint. One use case is the historical `state_events_at_start`;
305+
since each is marked as an `outlier`, the `EventContext.for_outlier()` won't
306+
have any `state_ids` set and therefore can't derive any state even though the
307+
prev_events are set so we need to set them ourself via this argument.
308+
This should normally be left as None, which will cause the auth_event_ids
309+
to be calculated based on the room state at the prev_events.
308310
309311
txn_id:
310312
ratelimit:
@@ -497,11 +499,13 @@ async def update_membership(
497499
Should normally be left as None, which will cause them to be calculated
498500
based on the room state at the prev_events.
499501
state_event_ids:
500-
The full state at a given event. The state events will be stripped down to
501-
only what's necessary to auth the given event and set as the auth_event_ids.
502-
This is particularly used by the MSC2716 /batch_send endpoint. This should
503-
normally be left as None, which will cause the auth_event_ids to be
504-
calculated based on the room state at the prev_events.
502+
The full state at a given event. This is used particularly by the MSC2716
503+
/batch_send endpoint. One use case is the historical `state_events_at_start`;
504+
since each is marked as an `outlier`, the `EventContext.for_outlier()` won't
505+
have any `state_ids` set and therefore can't derive any state even though the
506+
prev_events are set so we need to set them ourself via this argument.
507+
This should normally be left as None, which will cause the auth_event_ids
508+
to be calculated based on the room state at the prev_events.
505509
506510
Returns:
507511
A tuple of the new event ID and stream ID.
@@ -599,11 +603,13 @@ async def update_membership_locked(
599603
Should normally be left as None, which will cause them to be calculated
600604
based on the room state at the prev_events.
601605
state_event_ids:
602-
The full state at a given event. The state events will be stripped down to
603-
only what's necessary to auth the given event and set as the auth_event_ids.
604-
This is particularly used by the MSC2716 /batch_send endpoint. This should
605-
normally be left as None, which will cause the auth_event_ids to be
606-
calculated based on the room state at the prev_events.
606+
The full state at a given event. This is used particularly by the MSC2716
607+
/batch_send endpoint. One use case is the historical `state_events_at_start`;
608+
since each is marked as an `outlier`, the `EventContext.for_outlier()` won't
609+
have any `state_ids` set and therefore can't derive any state even though the
610+
prev_events are set so we need to set them ourself via this argument.
611+
This should normally be left as None, which will cause the auth_event_ids
612+
to be calculated based on the room state at the prev_events.
607613
608614
Returns:
609615
A tuple of the new event ID and stream ID.

0 commit comments

Comments
 (0)