fix: not setting inviter to a user that already left the room#3
Merged
fix: not setting inviter to a user that already left the room#3
Conversation
Contributor
There was a problem hiding this comment.
Pull Request Overview
This PR fixes a bug where the system could set an inviter to a user who has already left the room. The fix ensures that only active room members can be selected as inviters when processing room invitations.
- Adds a membership check to the
get_inviter_userfunction to verify users are still room members before considering them as potential inviters - Introduces comprehensive end-to-end tests covering scenarios where admin users leave rooms in both SQLite and PostgreSQL environments
- Adds utility methods for room operations including power level management, room joining/leaving, and user invitations
Reviewed Changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 4 comments.
| File | Description |
|---|---|
| synapse_room_code/get_inviter_user.py | Adds membership verification to prevent selecting users who have left the room as inviters |
| tests/test_e2e.py | Adds comprehensive test coverage and utility methods for the room membership scenarios |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
- Created _test_knock_with_code_admin_left_common() helper method - Eliminated ~90+ lines of duplicate code between SQLite and PostgreSQL tests - Improved maintainability while maintaining full test coverage - All tests passing with clean linting
…pse-room-code into fix-inviter-left
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.