Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unicode characters not rendered correctly in outgoing webhooks #3149

Closed
mderynck opened this issue Oct 16, 2023 · 2 comments
Closed

Unicode characters not rendered correctly in outgoing webhooks #3149

mderynck opened this issue Oct 16, 2023 · 2 comments
Assignees
Labels

Comments

@mderynck
Copy link
Contributor

What went wrong?

What happened:

  • Creating a data template for an outgoing webhook with unicode characters in the data results in them being rendered as //u0000 instead of the actual character. The character displays correctly in the last events/ custom payload area.

What did you expect to happen:

  • The characters should be rendered the same as in the event.

How do we reproduce it?

  1. Open Grafana OnCall navigate to Outgoing Webhooks
  2. Create a new Advanced Webhook and open the editor for a templated field such as Data
  3. Choose use a custom payload, add the following payload
{
  "annotations":{
    "description":"東京",
    "summary":"Notification test"
  }
}
  1. Add a template that renders the data:
{{ annotations|tojson_pretty }}
  1. Note in the preview the result is:
{
"description": "\\u6771\\u4eac",
"summary": "Notification test"
}

Grafana OnCall Version

v1.3.43

Product Area

Alert Flow & Configuration

Grafana OnCall Platform?

None

User's Browser?

No response

Anything else to add?

Rendering unicode characters works correctly for templates on integrations. Likely cause is somewhere there is a difference between the preview_template endpoints for integrations and webhooks.

@maskin25
Copy link
Contributor

agreed with @mderynck that this will be fixed on the backend side

github-merge-queue bot pushed a commit that referenced this issue Jan 11, 2024
# What this PR does
Fixes escaping for unicode characters in webhooks.

## Which issue(s) this PR fixes
#3149 

## Checklist

- [x] Unit, integration, and e2e (if applicable) tests updated
- [x] Documentation added (or `pr:no public docs` PR label added if not
required)
- [x] `CHANGELOG.md` updated (or `pr:no changelog` PR label added if not
required)
@joeyorlando
Copy link
Contributor

going to close as it looks like this was addressed in #3670

iskhakov pushed a commit that referenced this issue Feb 20, 2024
# What this PR does
Fixes escaping for unicode characters in webhooks.

## Which issue(s) this PR fixes
#3149 

## Checklist

- [x] Unit, integration, and e2e (if applicable) tests updated
- [x] Documentation added (or `pr:no public docs` PR label added if not
required)
- [x] `CHANGELOG.md` updated (or `pr:no changelog` PR label added if not
required)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants