-
Notifications
You must be signed in to change notification settings - Fork 86
Add better logging for handling invites. #1115
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
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -1242,23 +1242,32 @@ export class Bridge { | |||||
| roomId: string, | ||||||
| event: MatrixEvent<MatrixMemberContent>, | ||||||
| ) { | ||||||
| log.debug( | ||||||
| `Got invite roomId=${roomId} from=${event.sender} to=${event.state_key}`, | ||||||
| ); | ||||||
| if (this.as.isNamespacedUser(event.sender)) { | ||||||
| log.debug( | ||||||
| `Rejecting invite as sender is in our namespace`, | ||||||
| ); | ||||||
| /* Do not handle invites from our users */ | ||||||
| return; | ||||||
| } | ||||||
| const invitedUserId = event.state_key; | ||||||
| if (!invitedUserId) { | ||||||
| log.debug( | ||||||
| `Rejecting invite state key was empty!`, | ||||||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
More context in the log line itself, to help with searching individual lines |
||||||
| ); | ||||||
| return; | ||||||
| } | ||||||
| log.info( | ||||||
| `Got invite roomId=${roomId} from=${event.sender} to=${invitedUserId}`, | ||||||
| `Processing invite from ${event.sender} to ${roomId} for ${invitedUserId}`, | ||||||
| ); | ||||||
|
|
||||||
| const botUser = this.botUsersManager.getBotUser(invitedUserId); | ||||||
| if (!botUser) { | ||||||
| // We got an invite but it's not a configured bot user, must be for a ghost user | ||||||
| log.debug( | ||||||
| `Rejecting invite to room ${roomId} for ghost user ${invitedUserId}`, | ||||||
| `Rejecting invite to room ${roomId} for non-bot user ${invitedUserId}`, | ||||||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
More context in the log line itself, to help with searching individual lines |
||||||
| ); | ||||||
| const client = this.as.getIntentForUserId(invitedUserId).underlyingClient; | ||||||
| return client.leaveRoom(roomId, "Bridge does not support DMing ghosts."); | ||||||
|
|
||||||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
More context in the log line itself, to help with searching individual lines