fix: reject conflicting body flags in broadcast create/update#214
Merged
felipefreitag merged 3 commits intomainfrom Apr 9, 2026
Merged
fix: reject conflicting body flags in broadcast create/update#214felipefreitag merged 3 commits intomainfrom
felipefreitag merged 3 commits intomainfrom
Conversation
Member
Author
|
@cubic-dev-ai review this PR? |
Contributor
@bukinoshita I have started the AI code review. It will take a few minutes to complete. |
Contributor
There was a problem hiding this comment.
3 issues found across 4 files
Prompt for AI agents (unresolved issues)
Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.
<file name="src/commands/broadcasts/update.ts">
<violation number="1" location="src/commands/broadcasts/update.ts:113">
P2: Move the new body-flag conflict checks before `pickId()`, otherwise invalid input can still prompt/fetch broadcasts or surface `missing_id` before `invalid_options`.</violation>
</file>
<file name="src/commands/broadcasts/create.ts">
<violation number="1" location="src/commands/broadcasts/create.ts:189">
P2: Validate the new mutually exclusive body flags before any prompting or API-dependent setup so invalid options fail immediately.</violation>
<violation number="2" location="src/commands/broadcasts/create.ts:189">
P2: Check for option presence (`!== undefined`) instead of truthiness, or empty-string inline values bypass the new conflict rejection.</violation>
</file>
Reply with feedback, questions, or to request a fix. Tag @cubic-dev-ai to re-run a review, or fix all with cubic.
felipefreitag
requested changes
Apr 9, 2026
Contributor
felipefreitag
left a comment
There was a problem hiding this comment.
I consider the Cubic issues valid, I'm open to discussing them
Replace warning-and-overwrite behavior with hard errors when both --html and --html-file, or --text and --text-file, are provided to broadcasts create and broadcasts update commands. This matches the safer pattern already used in templates update, which rejects --html/--html-file conflicts as invalid_options. The previous behavior silently used the file content, which could lead to unintended campaign content being saved or sent. Closes BU-660 Co-authored-by: Bu Kinoshita <bukinoshita@users.noreply.github.com>
Move --html/--html-file and --text/--text-file conflict checks before pickId() and interactive prompts so invalid options fail immediately. Use !== undefined instead of truthiness in create.ts to catch empty string values from variable substitution or scripts.
2a52a91 to
7d45bed
Compare
felipefreitag
approved these changes
Apr 9, 2026
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 by cubic
Rejects conflicting broadcast body flags to prevent unintended campaign content.
broadcasts createandbroadcasts updatenow exit withinvalid_optionswhen both inline and file sources are provided, resolving BU-660.--html+--html-fileand--text+--text-fileas mutually exclusive; throwinvalid_optionsinstead of warning and overwriting.Written for commit 8672605. Summary will update on new commits.