Skip to content

fix: preserve JSON quotes in Apprise MQTT notifications - #641

Open
guillochon wants to merge 1 commit into
Nachtzuster:mainfrom
guillochon:fix/apprise-mqtt-json-quotes
Open

fix: preserve JSON quotes in Apprise MQTT notifications#641
guillochon wants to merge 1 commit into
Nachtzuster:mainfrom
guillochon:fix/apprise-mqtt-json-quotes

Conversation

@guillochon

Copy link
Copy Markdown

Summary

  • Unescape HTML entities (e.g. ") when reading the Apprise notification body so JSON payloads keep real quotes instead of entities.
  • Omit the notification title when the body is JSON, because title-less services like MQTT prepend the title and break the payload.
  • Harden the settings UI round-trip for the body (html_entity_decode on save/test, htmlspecialchars when rendering the textarea) and add a regression test.

Test plan

  • Set Apprise body to a JSON template with quoted fields (e.g. {"Common_Name": "$comname", ...}) and an mqtt:// destination
  • Update Settings, then Send Test Notification
  • Confirm the MQTT payload is valid JSON with real " characters and no prepended title
  • Confirm a normal (non-JSON) text body still includes the title as before
  • Run python -m unittest tests.test_apprise_notifications

Made with Cursor

HTML entities in body.txt were sent literally and MQTT prepended the
title onto JSON bodies, both of which produced invalid payloads.

Co-authored-by: Cursor <cursoragent@cursor.com>
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.

1 participant