Repository navigation
fix(destinations): Handle unicode characters in webhook notifications - #7586
Conversation
|
Thank you for your contribution! And, if we create a test, I think the test should be in the file related to the class, like Also, I think the test is optional for this quite simple PR. |
Thankyou for yout comment! |
I think so, if we add the test. |
arikfr
left a comment
There was a problem hiding this comment.
Can you elaborate on "webhook notifications would fail if they contained unicode characters in the alert data" -- when would it fail?
I would imagine something like this was needed in Python 2, but in Python 3 it uses Unicode strings which supposed to "just" work.
It will be beneficial if the test was reproducing the actual issue. In this case the test verifies we send bytes to requests.post, but does not really show case the error.
|
As written in the issue(#7468) PR author created, And, following Here is the stack trace when the error happens: |
|
@yoshiokatsuneo thank you for the elaborate explanation! For a moment I thought that maybe we should use the |
84cb8c8 to
fa94b9a
Compare
updated |
Previously, webhook notifications would fail if they contained unicode characters in the alert data. This was because the JSON payload was not UTF-8 encoded before being sent. This commit fixes the issue by explicitly encoding the JSON data to UTF-8 and adds a test to verify the fix.
fa94b9a to
eee1947
Compare
|
I just approved and merged the PR. |
* master: (69 commits) Update Python version to 3.13 (getredash#7636) Update plotly.js to 3.3.1, react-pivottable to 0.11.0 (getredash#7634) Add charset option to RDS MySQL datasource (getredash#7616) Aggregate y value for same x (getredash#7631) fix(mysql): Change default charset to utf8mb4 (getredash#7615) Update packages for compatibility with setuptools 82 (getredash#7622) Snapshot: 26.02.0-dev chore: support ipv6 for server in docker (getredash#7596) Add impersonation option in trino datasource (getredash#7605) Fix Elasticsearch connector configuration key mismatch (getredash#7607) duckdb: Show catalog (database) where applicable (e.g. Motherduck) (getredash#7599) Snapshot: 26.01.0-dev Feature/catch notsupported exception (getredash#7573) Multi-org: format base path, not including protocol (getredash#7260) fix(destinations): Handle unicode characters in webhook notifications (getredash#7586) Persist updated values and apply saved dashboard parameters (getredash#7570) Add ibm-db package to enable DB2 as datasource: (getredash#7581) Snapshot: 25.12.0-dev PostgreSQL: allow connection parameters to be specified (getredash#7579) Add lineShape option for Line and Area charts (getredash#7582) ...
Previously, webhook notifications would fail if they contained unicode characters in the alert data. This was because the JSON payload was not UTF-8 encoded before being sent.
This commit fixes the issue by explicitly encoding the JSON data to UTF-8 and adds a test to verify the fix.
What type of PR is this?
Description
How is this tested?
Related Tickets & Documents
#7468
Mobile & Desktop Screenshots/Recordings (if there are UI changes)