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

Clean up update_membership declaration #7809

Merged
merged 1 commit into from
Jul 9, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions changelog.d/7809.bugfix
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Fix 'stuck invites' which happen when we are unable to reject a room invite received over federation.
8 changes: 4 additions & 4 deletions synapse/handlers/room_member.py
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ async def remote_reject_invite(
txn_id: Optional[str],
requester: Requester,
content: JsonDict,
) -> Tuple[Optional[str], int]:
) -> Tuple[str, int]:
"""
Rejects an out-of-band invite we have received from a remote server

Expand Down Expand Up @@ -268,7 +268,7 @@ async def update_membership(
ratelimit: bool = True,
content: Optional[dict] = None,
require_consent: bool = True,
) -> Tuple[Optional[str], int]:
) -> Tuple[str, int]:
key = (room_id,)

with (await self.member_linearizer.queue(key)):
Expand Down Expand Up @@ -299,7 +299,7 @@ async def _update_membership(
ratelimit: bool = True,
content: Optional[dict] = None,
require_consent: bool = True,
) -> Tuple[Optional[str], int]:
) -> Tuple[str, int]:
content_specified = bool(content)
if content is None:
content = {}
Expand Down Expand Up @@ -1006,7 +1006,7 @@ async def remote_reject_invite(
txn_id: Optional[str],
requester: Requester,
content: JsonDict,
) -> Tuple[Optional[str], int]:
) -> Tuple[str, int]:
"""
Rejects an out-of-band invite received from a remote user

Expand Down
2 changes: 1 addition & 1 deletion synapse/handlers/room_member_worker.py
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ async def remote_reject_invite(
txn_id: Optional[str],
requester: Requester,
content: dict,
) -> Tuple[Optional[str], int]:
) -> Tuple[str, int]:
"""
Rejects an out-of-band invite received from a remote user

Expand Down
6 changes: 2 additions & 4 deletions synapse/rest/client/v1/room.py
Original file line number Diff line number Diff line change
Expand Up @@ -217,10 +217,8 @@ async def on_PUT(self, request, room_id, event_type, state_key, txn_id=None):
)
event_id = event.event_id

ret = {} # type: dict
if event_id:
set_tag("event_id", event_id)
ret = {"event_id": event_id}
set_tag("event_id", event_id)
ret = {"event_id": event_id}
return 200, ret


Expand Down