This repository was archived by the owner on Apr 26, 2024. It is now read-only.
File tree Expand file tree Collapse file tree 3 files changed +21
-3
lines changed
Expand file tree Collapse file tree 3 files changed +21
-3
lines changed Original file line number Diff line number Diff line change 1+ Faster joins: handle join during fast join.
Original file line number Diff line number Diff line change @@ -599,6 +599,8 @@ async def do_invite_join(
599599 except ValueError :
600600 pass
601601
602+ already_partially_joined = await self .store .is_partial_state_room (room_id )
603+
602604 ret = await self .federation_client .send_join (
603605 host_list , event , room_version_obj
604606 )
@@ -629,7 +631,7 @@ async def do_invite_join(
629631 state_events = state ,
630632 )
631633
632- if ret .partial_state :
634+ if ret .partial_state and not already_partially_joined :
633635 # Mark the room as having partial state.
634636 # The background process is responsible for unmarking this flag,
635637 # even if the join fails.
@@ -676,7 +678,7 @@ async def do_invite_join(
676678 # state for the room.
677679 # If the join failed, the background process is responsible for
678680 # cleaning up — including unmarking the room as a partial state room.
679- if ret .partial_state :
681+ if ret .partial_state and not already_partially_joined :
680682 # Kick off the process of asynchronously fetching the state for this
681683 # room.
682684 run_as_background_process (
Original file line number Diff line number Diff line change @@ -821,10 +821,25 @@ async def update_membership_locked(
821821 origin_server_ts = origin_server_ts ,
822822 )
823823
824+ is_partial_state_room = await self .store .is_partial_state_room (room_id )
825+
826+ await_full_state = True
827+ # Join is ok because instead of relying on the events to validate it if the
828+ # server is already partially joined, we will do make_join-send_join
829+ #
830+ # Leave doesn't really need validation: if the target has been banned in the
831+ # meantime, we should have received the event and if not, state res at fed
832+ # level will take care of solving the discrepancy.
833+ if is_partial_state_room :
834+ if get_domain_from_id (
835+ target .to_string ()
836+ ) == self ._server_name and action in [Membership .JOIN , Membership .LEAVE ]:
837+ await_full_state = False
838+
824839 latest_event_ids = await self .store .get_prev_events_for_room (room_id )
825840
826841 state_before_join = await self .state_handler .compute_state_after_events (
827- room_id , latest_event_ids
842+ room_id , latest_event_ids , await_full_state = await_full_state
828843 )
829844
830845 # TODO: Refactor into dictionary of explicitly allowed transitions
You can’t perform that action at this time.
0 commit comments