Fix OnUpgrade-only notifications never enabling and Discord empty username - #151
Open
jordanfelle wants to merge 1 commit into
Open
jordanfelle wants to merge 1 commit into
jordanfelle wants to merge 1 commit into
Conversation
…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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
NotificationDefinition.Enablechecked(OnReleaseImport && OnUpgrade)instead ofOnUpgradeon its own, so a notification configured only for upgrades (e.g. "only tell me about upgrades") computedEnable = falseand silently never fired, even though the API/UI showed the trigger checked.CreatePayloadunconditionally setUsername = Settings.Username, which is""when the field is left blank. Discord's webhook API rejects an emptyusernameoutright (Must be between 1 and 80 in length), and sinceNullValueHandling.Ignoreonly omitsnull(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
onUpgrade: truenow returnsenable: true.usernameleft blank now sends a test message successfully instead of Discord returning a 400 (Username cannot be "").dotnet buildsucceeds with no new warnings/errors.Fixes #150
🤖 Generated with Claude Code
https://claude.ai/code/session_01ED3rga2EPdAvo3ChtnJCtH