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

Commit 6f29437

Browse files
Remove unused auth_event_ids argument plumbing (#12304)
Follow-up to #12083 Since we are now using the new `state_event_ids` parameter to do all of the heavy lifting. We can remove any spots where we plumbed `auth_event_ids` just for MSC2716 things in https://github.com/matrix-org/synapse/pull/9247/files. Removing `auth_event_ids` from following functions: - `create_and_send_nonmember_event` - `_local_membership_update` - `update_membership` - `update_membership_locked`
1 parent 287a9c1 commit 6f29437

File tree

3 files changed

+1
-27
lines changed

3 files changed

+1
-27
lines changed

changelog.d/12304.misc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Refactor `create_new_client_event` to use a new parameter, `state_event_ids`, which accurately describes the usage with [MSC2716](https://github.com/matrix-org/matrix-doc/pull/2716) instead of abusing `auth_event_ids`.

synapse/handlers/message.py

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -782,7 +782,6 @@ async def create_and_send_nonmember_event(
782782
event_dict: dict,
783783
allow_no_prev_events: bool = False,
784784
prev_event_ids: Optional[List[str]] = None,
785-
auth_event_ids: Optional[List[str]] = None,
786785
state_event_ids: Optional[List[str]] = None,
787786
ratelimit: bool = True,
788787
txn_id: Optional[str] = None,
@@ -807,12 +806,6 @@ async def create_and_send_nonmember_event(
807806
The event IDs to use as the prev events.
808807
Should normally be left as None to automatically request them
809808
from the database.
810-
auth_event_ids:
811-
The event ids to use as the auth_events for the new event.
812-
Should normally be left as None, which will cause them to be calculated
813-
based on the room state at the prev_events.
814-
815-
If non-None, prev_event_ids must also be provided.
816809
state_event_ids:
817810
The full state at a given event. This is used particularly by the MSC2716
818811
/batch_send endpoint. One use case is with insertion events which float at
@@ -878,7 +871,6 @@ async def create_and_send_nonmember_event(
878871
txn_id=txn_id,
879872
allow_no_prev_events=allow_no_prev_events,
880873
prev_event_ids=prev_event_ids,
881-
auth_event_ids=auth_event_ids,
882874
state_event_ids=state_event_ids,
883875
outlier=outlier,
884876
historical=historical,

synapse/handlers/room_member.py

Lines changed: 0 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -271,7 +271,6 @@ async def _local_membership_update(
271271
membership: str,
272272
allow_no_prev_events: bool = False,
273273
prev_event_ids: Optional[List[str]] = None,
274-
auth_event_ids: Optional[List[str]] = None,
275274
state_event_ids: Optional[List[str]] = None,
276275
txn_id: Optional[str] = None,
277276
ratelimit: bool = True,
@@ -295,10 +294,6 @@ async def _local_membership_update(
295294
events should have a prev_event and we should only use this in special
296295
cases like MSC2716.
297296
prev_event_ids: The event IDs to use as the prev events
298-
auth_event_ids:
299-
The event ids to use as the auth_events for the new event.
300-
Should normally be left as None, which will cause them to be calculated
301-
based on the room state at the prev_events.
302297
state_event_ids:
303298
The full state at a given event. This is used particularly by the MSC2716
304299
/batch_send endpoint. One use case is the historical `state_events_at_start`;
@@ -361,7 +356,6 @@ async def _local_membership_update(
361356
txn_id=txn_id,
362357
allow_no_prev_events=allow_no_prev_events,
363358
prev_event_ids=prev_event_ids,
364-
auth_event_ids=auth_event_ids,
365359
state_event_ids=state_event_ids,
366360
require_consent=require_consent,
367361
outlier=outlier,
@@ -465,7 +459,6 @@ async def update_membership(
465459
historical: bool = False,
466460
allow_no_prev_events: bool = False,
467461
prev_event_ids: Optional[List[str]] = None,
468-
auth_event_ids: Optional[List[str]] = None,
469462
state_event_ids: Optional[List[str]] = None,
470463
) -> Tuple[str, int]:
471464
"""Update a user's membership in a room.
@@ -494,10 +487,6 @@ async def update_membership(
494487
events should have a prev_event and we should only use this in special
495488
cases like MSC2716.
496489
prev_event_ids: The event IDs to use as the prev events
497-
auth_event_ids:
498-
The event ids to use as the auth_events for the new event.
499-
Should normally be left as None, which will cause them to be calculated
500-
based on the room state at the prev_events.
501490
state_event_ids:
502491
The full state at a given event. This is used particularly by the MSC2716
503492
/batch_send endpoint. One use case is the historical `state_events_at_start`;
@@ -544,7 +533,6 @@ async def update_membership(
544533
historical=historical,
545534
allow_no_prev_events=allow_no_prev_events,
546535
prev_event_ids=prev_event_ids,
547-
auth_event_ids=auth_event_ids,
548536
state_event_ids=state_event_ids,
549537
)
550538

@@ -567,7 +555,6 @@ async def update_membership_locked(
567555
historical: bool = False,
568556
allow_no_prev_events: bool = False,
569557
prev_event_ids: Optional[List[str]] = None,
570-
auth_event_ids: Optional[List[str]] = None,
571558
state_event_ids: Optional[List[str]] = None,
572559
) -> Tuple[str, int]:
573560
"""Helper for update_membership.
@@ -598,10 +585,6 @@ async def update_membership_locked(
598585
events should have a prev_event and we should only use this in special
599586
cases like MSC2716.
600587
prev_event_ids: The event IDs to use as the prev events
601-
auth_event_ids:
602-
The event ids to use as the auth_events for the new event.
603-
Should normally be left as None, which will cause them to be calculated
604-
based on the room state at the prev_events.
605588
state_event_ids:
606589
The full state at a given event. This is used particularly by the MSC2716
607590
/batch_send endpoint. One use case is the historical `state_events_at_start`;
@@ -736,7 +719,6 @@ async def update_membership_locked(
736719
ratelimit=ratelimit,
737720
allow_no_prev_events=allow_no_prev_events,
738721
prev_event_ids=prev_event_ids,
739-
auth_event_ids=auth_event_ids,
740722
state_event_ids=state_event_ids,
741723
content=content,
742724
require_consent=require_consent,
@@ -961,7 +943,6 @@ async def update_membership_locked(
961943
txn_id=txn_id,
962944
ratelimit=ratelimit,
963945
prev_event_ids=latest_event_ids,
964-
auth_event_ids=auth_event_ids,
965946
state_event_ids=state_event_ids,
966947
content=content,
967948
require_consent=require_consent,

0 commit comments

Comments
 (0)