Skip to content

[Bug]: Mattermost private channels (type "P") silently misclassified as public channels #29830

@BlueBirdBack

Description

@BlueBirdBack

Summary

In extensions/mattermost/src/mattermost/monitor.ts, the channelKind helper only special-cases "D" (direct) and "G" (group) channel types. Mattermost private channels, which use type "P", fall through to the default "channel" case and are treated as public channels.

Impact

Private channel messages are routed and handled as if they were public — potentially affecting groupPolicy, requireMention, and other access controls that behave differently for private vs public contexts.

Steps to reproduce

  1. Configure a Mattermost account with access to a private channel (type P)
  2. Send a message to the private channel
  3. Observe it is processed with channelKind = "channel" instead of "private-channel" or similar

Suggested fix

Add a case for "P" in channelKind:

case "P":
  return "private-channel";

And ensure downstream routing/policy logic handles "private-channel" appropriately.

Version

Latest main (identified in extensions/mattermost/src/mattermost/monitor.ts)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions