dgtlmoon / changedetection.io

The best and simplest free open source web page change detection, website watcher, restock monitor and notification service. Restock Monitor, change detection. Designed for simplicity - Simply monitor which websites had a text change for free. Free Open source web page change detection, Website defacement monitoring, Price change notification
https://changedetection.io
Apache License 2.0
17.3k stars 965 forks source link

jsons:// notification results in empty body #1923

Closed Christilut closed 11 months ago

Christilut commented 11 months ago

Describe the bug JSON body with jsons:// not working. No additional keys appears to be getting added in the body.

Version Exact version in the top right area: 0.45.5

To Reproduce

Steps to reproduce the behavior:

  1. Go to settings, Notifications

  2. Use a jsons url (this is a test url from RequestBin):

    jsons://eo9r1d6nv9dr6um.m.pipedream.net
  3. Add a JSON body:

    {
    "watchtitle": "{{watch_title}}"
    }
  4. Send test notification The following body arrives:

    {"version":"1.0","title":"ChangeDetection.io Notification - https://changedetection.server/settings#notifications","message":"https://changedetection.server/settings#notifications had a change.\n---\n\n---","attachments":[],"type":"info"}
  5. In the debug logs, it shows:

    2023/11/01 19:13:10,000 - SENDING - [{"title": "ChangeDetection.io Notification - https://changedetection.server/settings#notifications", "body": "https://changedetection.server/settings#notifications had a change.\n---\n\n---", "url": "jsons://eo9r1d6nv9dr6um.m.pipedream.net?avatar_url=https://raw.githubusercontent.com/dgtlmoon/changedetection.io/master/changedetectionio/static/images/avatar-256x256.png", "body_format": "text"}]

Expected behavior I expected the body to look like:

{
  "version": "1.0",
  "title": "ChangeDetection.io Notification - https://changedetection.rekord.cloud/settings#notifications",
  "message": "https://changedetection.rekord.cloud/settings#notifications had a change.\n---\n\n---",
  "attachments": [],
  "type": "info",
  "watchtitle": "My Watch Title"
}
dgtlmoon commented 11 months ago

heya

is the body actually empty, or is it just missing "watchtitle": "My Watch Title" ?

dgtlmoon commented 11 months ago

and did you try both as 'test notification' and a real notification? any difference?

Christilut commented 11 months ago

There is a body sent (step 4), but it's missing the watchTitle key.

Just tried a real notification and it does add the expected keys, so it seems to be only in the test notifications. Didn't realize that would be different, solved then.

Thanks!

dgtlmoon commented 11 months ago

Dont feel bad https://github.com/dgtlmoon/changedetection.io/issues/1898

its sort a loose-end, it doesnt store the second-most-recent snapshot yet, so it cant rebuild the 'test notification' correctly, But we're working on that

Christilut commented 11 months ago

No worries, thanks for the fast reply! Great work :)