Skip to content

refactor(sns): extract publish_to_phone_number from publish#333

Merged
vieiralucas merged 1 commit intomainfrom
worktree-cleanup+sns-splits
Apr 13, 2026
Merged

refactor(sns): extract publish_to_phone_number from publish#333
vieiralucas merged 1 commit intomainfrom
worktree-cleanup+sns-splits

Conversation

@vieiralucas
Copy link
Copy Markdown
Member

@vieiralucas vieiralucas commented Apr 13, 2026

Summary

The `publish` operation is a 470-line giant because it juggles three very different destinations: a `PhoneNumber` (direct SMS), a platform endpoint ARN, and a topic ARN that fans out to SQS/HTTP/Lambda/email/SMS subscribers. The SMS branch had its own E.164 validation, its own 1600-character length cap, and its own response-building path — everything it needed to stand on its own.

Move it into `publish_to_phone_number`. `publish` is still long (the topic fan-out is still inline) but it no longer carries the SMS special case. No behavior change.

Test plan

  • `cargo fmt`
  • `cargo clippy --workspace --all-targets -- -D warnings`
  • `cargo test -p fakecloud-sns` (48 passed)

Summary by cubic

Extracted the SMS PhoneNumber path from publish into publish_to_phone_number in fakecloud-sns to simplify the publish flow. No behavior change.

  • Refactors
    • Moved E.164 validation, 1600-char limit, state updates, and XML response into publish_to_phone_number.
    • publish now delegates when PhoneNumber is present; topic fan-out stays inline.

Written for commit 27a71b4. Summary will update on new commits.

The publish operation is a 470-line giant because it juggles three
very different destinations: a PhoneNumber (direct SMS), a platform
endpoint ARN, and a topic ARN that fans out to SQS/HTTP/Lambda/email/
SMS subscribers. The SMS branch had its own E.164 validation, its
own 1600-character length cap, and its own response-building path —
everything it needed to stand on its own.

Move it into publish_to_phone_number. publish is still long (the
topic fan-out is still inline) but it no longer carries the SMS
special case. No behavior change.
Copy link
Copy Markdown

@cubic-dev-ai cubic-dev-ai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No issues found across 1 file

@vieiralucas vieiralucas merged commit cd22648 into main Apr 13, 2026
22 checks passed
@vieiralucas vieiralucas deleted the worktree-cleanup+sns-splits branch April 13, 2026 02:12
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