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

Commit

Permalink
update_membership declaration: now always returns an event id. (#7809)
Browse files Browse the repository at this point in the history
  • Loading branch information
richvdh authored Jul 9, 2020
1 parent 8ca39bd commit 53ee214
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 9 deletions.
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

0 comments on commit 53ee214

Please sign in to comment.