Skip to content

fix: not setting inviter to a user that already left the room#3

Merged
WilsonLe merged 5 commits intomainfrom
fix-inviter-left
Sep 4, 2025
Merged

fix: not setting inviter to a user that already left the room#3
WilsonLe merged 5 commits intomainfrom
fix-inviter-left

Conversation

@WilsonLe
Copy link
Collaborator

@WilsonLe WilsonLe commented Sep 4, 2025

No description provided.

Copilot AI review requested due to automatic review settings September 4, 2025 04:24
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

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_user function 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.

WilsonLe and others added 4 commits September 4, 2025 00:27
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
@WilsonLe WilsonLe merged commit 9c053f0 into main Sep 4, 2025
8 checks passed
@WilsonLe WilsonLe deleted the fix-inviter-left branch September 4, 2025 05:25
@WilsonLe WilsonLe restored the fix-inviter-left branch December 4, 2025 02:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants