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

Correct field name for stripped state events when knocking. knock_state_events -> knock_room_state #14102

Merged
merged 4 commits into from
Oct 12, 2022

Conversation

anoadragon453
Copy link
Member

Closes #14088.

This PR:

  • Attempts to pull out stripped state events from first a knock_room_state field (new name), then a knock_state_events field (old name) if present.
  • Returns stripped state events under both names if order to support older Synapse instances.

We now support both the new and old field name.
Comment on lines +800 to +803
raise KeyError(
"Missing 'knock_room_state' (or legacy 'knock_state_events') field in "
"send_knock response"
)
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think a different exception type would be more appropriate (and user-friendly) here. But I'm inclined not to change things too much in this PR.

The earlier code would have also raised a KeyError in the case the field was not present.

@anoadragon453 anoadragon453 marked this pull request as ready for review October 7, 2022 10:42
@anoadragon453 anoadragon453 requested a review from a team as a code owner October 7, 2022 10:42
Copy link
Contributor

@squahtx squahtx left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! Can we file an issue to remove knock_state_events?

@anoadragon453
Copy link
Member Author

Can we file an issue to remove knock_state_events?

Good shout! #14151

@anoadragon453
Copy link
Member Author

I believe the CI failure is a flake as it seems entirely unrelated to the code changes.

@anoadragon453 anoadragon453 merged commit 9c23442 into develop Oct 12, 2022
@anoadragon453 anoadragon453 deleted the anoa/fix_knock_field_name branch October 12, 2022 13:37
clokep pushed a commit that referenced this pull request Oct 12, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

When knocking, Synapse returns and accepts a list of stripped state events in an incorrectly named field
2 participants