Skip to content

Encode Mattermost payloads as UTF-8 - #7783

Open
DhruvShah-Dev wants to merge 1 commit into
getredash:masterfrom
DhruvShah-Dev:fix/mattermost-utf8-payload
Open

Encode Mattermost payloads as UTF-8#7783
DhruvShah-Dev wants to merge 1 commit into
getredash:masterfrom
DhruvShah-Dev:fix/mattermost-utf8-payload

Conversation

@DhruvShah-Dev

@DhruvShah-Dev DhruvShah-Dev commented Aug 9, 2026

Copy link
Copy Markdown

What type of PR is this?

Bug fix

Description

Mattermost webhook payloads were passed to requests.post as a Python string, which lets Requests encode the body as latin-1. This matches the Slack destination by sending UTF-8 bytes so non-ASCII alert text is preserved.

Fixes #7775

Validation

  • git diff --check
  • python -m pytest tests\destinations\test_mattermost.py (blocked locally: missing Redash runtime dependency redis)

Review in cubic

@greptile-apps

greptile-apps Bot commented Aug 9, 2026

Copy link
Copy Markdown

Greptile Summary

This PR aligns Mattermost webhook delivery with the Slack destination by explicitly encoding serialized JSON payloads as UTF-8 bytes.

  • Encodes Mattermost payloads as UTF-8 before passing them to Requests.
  • Adds coverage confirming Unicode alert subjects survive serialization and decoding.

Confidence Score: 5/5

The PR appears safe to merge, with the UTF-8 payload behavior covered by a focused regression test.

The changed request body remains valid serialized JSON while its encoding becomes explicit, matching an established sibling destination pattern without introducing a concrete failure.

Important Files Changed

Filename Overview
redash/destinations/mattermost.py Explicitly UTF-8 encodes the serialized Mattermost webhook payload; no actionable regression was identified.
tests/destinations/test_mattermost.py Adds focused coverage that the submitted body is bytes and preserves a non-ASCII alert subject.

Reviews (1): Last reviewed commit: "Encode Mattermost payloads as UTF-8" | Re-trigger Greptile

@cubic-dev-ai cubic-dev-ai Bot 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.

No issues found across 2 files

Re-trigger cubic

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.

Mattermost destination: non-ASCII characters broken (missing .encode("utf-8"))

1 participant