Skip to content

Add better logging for handling invites.#1115

Open
Half-Shot wants to merge 1 commit intomainfrom
hs/enhanced-invite-logging
Open

Add better logging for handling invites.#1115
Half-Shot wants to merge 1 commit intomainfrom
hs/enhanced-invite-logging

Conversation

@Half-Shot
Copy link
Copy Markdown
Contributor

We could be louder about why invites might fail.

@Half-Shot Half-Shot requested a review from a team as a code owner January 15, 2026 10:11
Comment thread src/Bridge.ts
);
if (this.as.isNamespacedUser(event.sender)) {
log.debug(
`Rejecting invite as sender is in our namespace`,
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Suggested change
`Rejecting invite as sender is in our namespace`,
`Rejecting invite to ${roomId} as sender ${event.sender} is in our namespace`,

More context in the log line itself, to help with searching individual lines

Comment thread src/Bridge.ts
const invitedUserId = event.state_key;
if (!invitedUserId) {
log.debug(
`Rejecting invite state key was empty!`,
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Suggested change
`Rejecting invite state key was empty!`,
`Rejecting invite from ${event.sender} to ${roomId} as state key (invited user) is empty!`,

More context in the log line itself, to help with searching individual lines

Comment thread src/Bridge.ts
// 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}`,
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Suggested change
`Rejecting invite to room ${roomId} for non-bot user ${invitedUserId}`,
`Rejecting invite from ${event.sender} to room ${roomId} for non-bot user ${invitedUserId}`,

More context in the log line itself, to help with searching individual lines

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