Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix bug when rejecting withdrew invite with a third_party_rules module #17930

Merged
merged 3 commits into from
Dec 10, 2024
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/17930.bugfix
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Fix bug when rejecting withdrew invite with a third_party_rules module, where the invite would be stuck for the client.
10 changes: 5 additions & 5 deletions synapse/events/snapshot.py
Original file line number Diff line number Diff line change
Expand Up @@ -248,21 +248,20 @@ def state_group(self) -> Optional[int]:
@tag_args
async def get_current_state_ids(
self, state_filter: Optional["StateFilter"] = None
) -> Optional[StateMap[str]]:
) -> StateMap[str]:
"""
Gets the room state map, including this event - ie, the state in ``state_group``

It is an error to access this for a rejected event, since rejected state should
not make it into the room state. This method will raise an exception if
``rejected`` is set.

It is also an error to access this for an outlier event.

Arg:
state_filter: specifies the type of state event to fetch from DB, example: EventTypes.JoinRules

Returns:
Returns None if state_group is None, which happens when the associated
event is an outlier.

Maps a (type, state_key) to the event ID of the state event matching
this tuple.
"""
Expand Down Expand Up @@ -300,7 +299,8 @@ async def get_prev_state_ids(
this tuple.
"""

assert self.state_group_before_event is not None
if self.state_group_before_event is None:
return {}
return await self._storage.state.get_state_ids_for_group(
self.state_group_before_event, state_filter
)
Expand Down
Loading