apprise icon indicating copy to clipboard operation
apprise copied to clipboard

fixes for zulip plugin

Open drewp opened this issue 8 months ago • 3 comments

Description:

Without looking into it much, I found that talking to zulip (self-hosted, zulip/docker-zulip:9.4-0) fails without a 'topic' key and succeeds with one.

Failure looks like this. Notice how the response body is critical for debugging, so I promoted it to warning:

[main] 2025-05-10 21:30:30,245 [WARNING] apprise: Zulip Payload: {'title': 'topic1', 'content': 'line1', 'type': 'stream', 'to': 'alerts'}
[main] 2025-05-10 21:30:30,292 [WARNING] apprise: Failed to send Zulip notification to alerts: Bad Request - Unsupported Parameters., error=400.
[main] 2025-05-10 21:30:30,292 [WARNING] apprise: Response Details:
[main] b'{"result":"error","msg":"Missing topic","code":"BAD_REQUEST"}\n'

Checklist

  • [ ] The code change is tested and works locally.
  • [x] There is no commented out code in this PR.
  • [ ] No lint errors (use flake8)
  • [ ] 100% test coverage

Testing

bin/test.sh didn't work for me, but grep topic test/test_plugin_zulip.py returns nothing :) so CI will probably pass.

drewp avatar May 11 '25 02:05 drewp

https://github.com/caronc/apprise/wiki/Notify_zulip should also be updated to say 'title' will be used as the topic, and it must be a nonempty string.

drewp avatar May 11 '25 02:05 drewp

Zulip supports both topic and subject depending on the message type. I think the true fix for this is to allow a ?mode= from the command line (argument) that allows you to control what the payload looks like (and toggle between all of the accepted kinds

caronc avatar May 24 '25 21:05 caronc

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Project coverage is 99.37%. Comparing base (ae7f8b8) to head (a14b88d). Report is 1 commits behind head on master.

Additional details and impacted files
@@           Coverage Diff           @@
##           master    #1330   +/-   ##
=======================================
  Coverage   99.37%   99.37%           
=======================================
  Files         161      161           
  Lines       21069    21069           
  Branches     3791     3791           
=======================================
  Hits        20938    20938           
  Misses        121      121           
  Partials       10       10           

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

:rocket: New features to boost your workflow:
  • :snowflake: Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

codecov[bot] avatar May 24 '25 21:05 codecov[bot]