frontend icon indicating copy to clipboard operation
frontend copied to clipboard

Fix trace download truncation with Jinja comments

Open LordMike opened this issue 1 week ago • 0 comments

Breaking change

(removed — not a breaking change)

Proposed change

Fix trace download truncation when the trace JSON contains Jinja comments like {# ... #} (the # was treated as a URL fragment delimiter when using a data: URL). The trace download now uses a Blob + URL.createObjectURL() to generate the download reliably.

Note: This code fix was made by codex.

Type of change

  • [ ] Dependency upgrade
  • [x] Bugfix (non-breaking change which fixes an issue)
  • [ ] New feature (thank you!)
  • [ ] Breaking change (fix/feature causing existing functionality to break)
  • [ ] Code quality improvements to existing code or addition of tests

Example configuration

No configuration needed.

Reproduction:

  • add a Jinja {# comment #} inside a script/automation template (see this for an example)
  • run it, then download the trace
  • observe the downloaded json file was truncated before this fix

Additional information

  • This PR fixes or closes issue: fixes home-assistant/core#146760
  • This PR is related to issue or discussion: https://github.com/home-assistant/core/issues/146760#issuecomment-3646379621
  • Link to documentation pull request:

Checklist

  • [ ] The code change is tested and works locally.
  • [x] There is no commented out code in this PR.
  • [ ] Tests have been added to verify that the new code works.

If user exposed functionality or configuration variables are added/changed:

  • [ ] Documentation added/updated for [www.home-assistant.io][docs-repository]

LordMike avatar Dec 12 '25 13:12 LordMike