fix(api): honor the Enabled checkbox on notification-channel create (#600) - #611
Merged
Conversation
The create form sends `enabled`, but CreateChannelRequest had no such field so serde dropped it and create hardcoded `enabled: true`. Unchecking Enabled while creating a channel produced an enabled channel anyway. Add `enabled` (serde default true, so legacy clients and the common case are unchanged) and honor it in create. Regression test covers enabled:false honored, absent-defaults-true, and persistence across a reload. Fixes #600 Signed-off-by: badbread <badbread@users.noreply.github.com>
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.
Fixes #600.
The new-channel form sends
enabled, butCreateChannelRequesthad no such field, so serde dropped it and create hardcodedenabled: true. Unchecking Enabled while creating a channel produced an enabled channel anyway.Fix: add
enabledtoCreateChannelRequestwith a serde default oftrue(legacy clients and the common case are byte-for-byte unchanged) and honor it in the create handler. No client change, the form already sends the field.Test:
create_honors_enabled_false_and_defaults_trueinnotification_pane.rscovers enabled:false honored, absent-defaults-true, and persistence across a reload.Gate green on dev2: fmt + clippy -D warnings +
cargo test --workspace.