Skip to content

Do not auto-invite Matrix bridge to all shared channels - #12

Merged
fmartingr merged 1 commit into
masterfrom
do_not_auto_invite
Jul 15, 2025
Merged

Do not auto-invite Matrix bridge to all shared channels #12
fmartingr merged 1 commit into
masterfrom
do_not_auto_invite

Conversation

@wiggin77

Copy link
Copy Markdown
Member

Summary

This PR fixes a bug where the Matrix bridge was being invited to all share channels that are created, and the Matrix bridge display name was shown in the tooltip for all shared channels.

The root cause is a flag used by mattermost-plugin-msteams-sync which needed to be invited to all shared channels. The reason this issue has not been seen before is that the tooltip was implemented only a month ago - long after msteams-sync plugin was widely used.

Ticket Link

NONE

@wiggin77 wiggin77 added the bug Something isn't working label Jul 15, 2025
@fmartingr

Copy link
Copy Markdown
Contributor

I am not sure this does what the comment says. What I see in the mattermost code is that if we receive an event for a channel from a remote with AutoInvite, the channel is automatically added as a remote channel, but I don't see where we modify every other channel remote (and it wouldn't make sense, right?)

@wiggin77

Copy link
Copy Markdown
Member Author

I am not sure this does what the comment says. What I see in the mattermost code is that if we receive an event for a channel from a remote with AutoInvite, the channel is automatically added as a remote channel, but I don't see where we modify every other channel remote (and it wouldn't make sense, right?)

@fmartingr My understanding is the bug reported has to do with the Matrix bridge showing up in all shared channels tooltips, even ones that were not shared with the bridge. Is that correct?

@fmartingr

Copy link
Copy Markdown
Contributor

I am not sure this does what the comment says. What I see in the mattermost code is that if we receive an event for a channel from a remote with AutoInvite, the channel is automatically added as a remote channel, but I don't see where we modify every other channel remote (and it wouldn't make sense, right?)

@fmartingr My understanding is the bug reported has to do with the Matrix bridge showing up in all shared channels tooltips, even ones that were not shared with the bridge. Is that correct?

Yes, it looks like it. Didn't set up a environment to reproduce it.

Maybe it's just me not understanding why "AutoInvite" sets the bridge in all channels (or where it does so).

@davidkrauser

Copy link
Copy Markdown

@wiggin77 it was a shared channel, but I don't think it is anymore. Matt said:

In fact, this channel shouldn't be identified as a shared at all anymore.

I think this could be due to the issue where shared channels are not cleaned up when they are un-shared?

@wiggin77

Copy link
Copy Markdown
Member Author

@wiggin77 it was a shared channel, but I don't think it is anymore. Matt said:

In fact, this channel shouldn't be identified as a shared at all anymore.

I think this could be due to the issue where shared channels are not cleaned up when they are un-shared?

It's both. This flag should be turned off for Matrix bridge. Remotes remaining after a channel is unshared is a separate issue.

@fmartingr fmartingr left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Preventively approving to discard a bug in a demo environment.

@fmartingr
fmartingr merged commit 58c4efc into master Jul 15, 2025
4 checks passed
@wiggin77
wiggin77 deleted the do_not_auto_invite branch October 17, 2025 21:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants