fix(mattermost): accept leading-space slash commands - #59127
Merged
Conversation
This was referenced Jul 5, 2026
14 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Slash commands now work for Mattermost mobile users: leading-space command messages (
/new) are normalized before command classification. Root cause: Mattermost mobile blocks sending messages that start with/and suggests prefixing a space, but the adapter's barestartswith("/")check treated" /new"as plain text (#25184).Salvage of #32210 by @l0h1nth — cherry-picked onto current main with authorship preserved. Duplicate cluster: #21070 (@MinJaeLee1, same fix submitted first but against the old pre-move
gateway/platforms/mattermost.pypath) and #29842 (broader whitespace-stripping approach that alters normal-text semantics).Changes
plugins/platforms/mattermost/adapter.py: lstrip leading whitespace only when the stripped text starts with/, right before command classification (+2 lines)tests/gateway/test_mattermost.py: 2 tests — leading-space command classified as COMMAND, leading-space normal text preserved verbatimscripts/release.py: AUTHOR_MAP entry for l0h1nthValidation
" /new"(DM)get_command() == "new"" hello"(DM)" hello"" hello"(unchanged)tests/gateway/test_mattermost.pyE2E: real
MattermostAdapter._handle_ws_event()with actual WSpostedpayloads against isolated HERMES_HOME — 5/5 cases pass including" /status arg"multi-space and bare/stop.Fixes #25184. Closes #32210, #21070, #29842.
Infographic