Skip to content

fix(dispatch): reject invalid command UUID overrides - #75

Merged
yordis merged 1 commit into
mainfrom
yordis/fix-command-uuid-contract
Apr 14, 2026
Merged

yordis merged 1 commit into
mainfrom
yordis/fix-command-uuid-contract

Conversation

@yordis

@yordis yordis commented Apr 14, 2026

Copy link
Copy Markdown
Member
  • Preserves the intended API shape where callers may supply a command UUID but omission still falls back to an internally generated value
  • Prevents explicit invalid overrides from quietly weakening command identity guarantees and drifting away from the documented contract

@cursor

cursor Bot commented Apr 14, 2026 •

Copy link
Copy Markdown

PR Summary

Medium Risk
Tightens validation for :command_uuid overrides during command dispatch, which may break callers that previously passed nil or non-binary values and relied on silent UUID generation.

Overview
Command dispatch now enforces a valid :command_uuid override. Router dispatching uses a new Router.fetch_command_uuid/1 helper to generate a UUID only when the option is omitted, and to raise an ArgumentError when :command_uuid is explicitly provided as nil or any non-binary value.

Docs for Commanded.Application.dispatch/2 and Commanded.Commands.Router.dispatch/2 were updated to clarify the “omitted vs provided” behavior, and tests were added to assert rejection of invalid overrides.

Reviewed by Cursor Bugbot for commit 73c3657. Bugbot is set up for automated code reviews on this repo. Configure here.

@coderabbitai

coderabbitai Bot commented Apr 14, 2026 •

Copy link
Copy Markdown

Warning

Rate limit exceeded

@yordis has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 3 minutes and 21 seconds before requesting another review.

Your organization is not enrolled in usage-based pricing. Contact your admin to enable usage-based pricing to continue reviews beyond the rate limit, or try again in 3 minutes and 21 seconds.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: a71010ca-d978-469d-9471-2ce89cbb664d

📥 Commits

Reviewing files that changed from the base of the PR and between 0813343 and 73c3657.

📒 Files selected for processing (3)
  • lib/application.ex
  • lib/commanded/commands/router.ex
  • test/commands/command_identity_test.exs
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch yordis/fix-command-uuid-contract

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@yordis
yordis force-pushed the yordis/fix-command-uuid-contract branch from 0e09fe4 to 88c9b80 Compare April 14, 2026 22:51
Signed-off-by: Yordis Prieto <yordis.prieto@gmail.com>
@yordis
yordis force-pushed the yordis/fix-command-uuid-contract branch from 88c9b80 to 73c3657 Compare April 14, 2026 22:54
@yordis
yordis merged commit 195a12b into main Apr 14, 2026
5 checks passed
@yordis
yordis deleted the yordis/fix-command-uuid-contract branch April 14, 2026 23:23
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.

1 participant