redash icon indicating copy to clipboard operation
redash copied to clipboard

JSON format in alert body is unintentionally escaped and broken when using alert template macro

Open takanau opened this issue 9 months ago • 1 comments

Issue Summary

When using alert template macro (ex: {{QUERY_RESULT_ROWS}}, cf) in alert body, the result is HTML escaped and its JSON format is broken like this:

[{'column': 1}]

Steps to Reproduce

  • https://github.com/getredash/redash/blob/master/redash/models/init.py#L1039
  • https://github.com/getredash/redash/blob/master/redash/utils/init.py#L139-L141

When rendering alert template, mustache_render should be used, not mustache_render_escape.

Technical details:

  • Redash Version: 24.12.0-dev

I guess this problem caused by #5996 (Version: 23.09.0)

takanau avatar Feb 05 '25 03:02 takanau