favonia / cloudflare-ddns

🌟 A small, feature-rich, and robust Cloudflare DDNS updater
Apache License 2.0
817 stars 36 forks source link

fix(monitor): a more powerful hack for quirks of Uptime Kuma #774

Closed favonia closed 3 months ago

favonia commented 3 months ago

Close #648.

favonia commented 3 months ago

@JvdMaat I'm not sure what caused the strange bug you reported. However, the generation of notification messages has been completely rewritten (to support shoutrrr) so hopefully the problem is gone now? This PR additionally trim the failure messages before applying the existing ugly hack, in case messages with only space or newline characters were ever generated and somehow they confused the Uptime Kuma server.

codecov[bot] commented 3 months ago

Codecov Report

Attention: Patch coverage is 33.33333% with 6 lines in your changes missing coverage. Please review.

Project coverage is 90.30%. Comparing base (fd56d30) to head (ecd4fbc).

Files Patch % Lines
cmd/ddns/ddns.go 0.00% 6 Missing :warning:
Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #774 +/- ## ======================================= Coverage 90.30% 90.30% ======================================= Files 52 52 Lines 2155 2156 +1 ======================================= + Hits 1946 1947 +1 Misses 198 198 Partials 11 11 ``` | [Flag](https://app.codecov.io/gh/favonia/cloudflare-ddns/pull/774/flags?src=pr&el=flags&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=favonia) | Coverage Δ | | |---|---|---| | [unittests](https://app.codecov.io/gh/favonia/cloudflare-ddns/pull/774/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=favonia) | `90.30% <33.33%> (+<0.01%)` | :arrow_up: | Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=favonia#carryforward-flags-in-the-pull-request-comment) to find out more.

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

favonia commented 3 months ago

@JvdMaat after reviewing the code I think the hack in this PR is overkill. I'm reverting it to a simpler/cleaner one that is hopefully sufficient. :detective: