Skip to content

Fix OnUpgrade-only notifications never enabling and Discord empty username - #151

Open
jordanfelle wants to merge 1 commit into
Chaptarr:developfrom
jordanfelle:fix-notification-onupgrade-discord-username
Open

jordanfelle wants to merge 1 commit into
Chaptarr:developfrom
jordanfelle:fix-notification-onupgrade-discord-username

Conversation

@jordanfelle

Copy link
Copy Markdown

Summary

  • NotificationDefinition.Enable checked (OnReleaseImport && OnUpgrade) instead of OnUpgrade on its own, so a notification configured only for upgrades (e.g. "only tell me about upgrades") computed Enable = false and silently never fired, even though the API/UI showed the trigger checked.
  • Discord's CreatePayload unconditionally set Username = Settings.Username, which is "" when the field is left blank. Discord's webhook API rejects an empty username outright (Must be between 1 and 80 in length), and since NullValueHandling.Ignore only omits null (not ""), the field was never actually dropped from the payload. The existing conditional re-assignment a few lines down (meant to guard exactly this) was already being overwritten by the unconditional initializer above it, so it was dead code.

Test plan

  • Confirmed via API: a Discord notification created with only onUpgrade: true now returns enable: true.
  • Confirmed via API: a Discord notification saved with username left blank now sends a test message successfully instead of Discord returning a 400 (Username cannot be "").
  • dotnet build succeeds with no new warnings/errors.

Fixes #150

🤖 Generated with Claude Code

https://claude.ai/code/session_01ED3rga2EPdAvo3ChtnJCtH

…rname

NotificationDefinition.Enable checked (OnReleaseImport && OnUpgrade)
instead of OnUpgrade on its own, so a notification configured only for
upgrades computed Enable = false and silently never fired.

Discord's CreatePayload always set Username = Settings.Username, which
is an empty string when left blank. Discord's webhook API rejects an
empty username outright (never omitted, since NullValueHandling.Ignore
only skips null, not ""), while the existing conditional assignment a
few lines down that was meant to guard this was already being
overwritten. Leaving the field unset when blank lets the serializer
omit it, matching the documented "defaults to Discord webhook default"
behavior.

Fixes Chaptarr#150

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01ED3rga2EPdAvo3ChtnJCtH
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.

Notifications: OnUpgrade never enables a provider on its own; Discord posts empty username and gets rejected

1 participant