FoxxMD / multi-scrobbler

Scrobble plays from multiple sources to multiple clients
https://foxxmd.github.io/multi-scrobbler
MIT License
404 stars 17 forks source link

bug: Gotify `version` check makes webook initialization unreliable #215

Open megatwig opened 3 days ago

megatwig commented 3 days ago

Please check existing knowledge before opening an issue

Describe the Bug

Gotify webhooks are initialized by calling the /version endpoint, and the webhook is only used if this call succeeds.

This check is never retried, so a transient error with your Gotify instance/your internet connection could mean no webhook notifications until multi-scrobbler is restarted. This could also happen if e.g. Gotify and multi-scrobbler are both running as docker containers on the same host, and multi-scrobbler starts up before gotify is ready.

https://github.com/FoxxMD/multi-scrobbler/blob/f308f71b5ddc5531fc330f7dd5ce3d1f86b8013f/src/backend/notifier/GotifyWebhookNotifier.ts#L35-L37

imo webhooks should be set up unconditionally - the only benefit I can see for failing on this version check is to avoid potentially sending out failing requests for the rest of the lifetime of the application, which is unlikely to cause major issues.

Platform

Docker

Versions

Logs

No response

Additional Context

nb: my true motivation for this is actually that I use Pushbits as a notification server which has a Gotify-compatible API but no /version endpoint. I filed an issue with them as it's not really compatible if it's missing API methods, but I'm not sure it's receiving active feature development

FoxxMD commented 2 days ago

Thanks for the detailed report. The intention behind checking version was mainly to let the user know if they have the URL for the endpoint correct. Since notifications aren't mission critical you are right it should send regardless and the check should instead just be a logged warning.

FoxxMD commented 2 days ago

Please try the docker image foxxmd/multi-scrobbler:pr-216 and let me know if this fixes things for you.