refactor(sns): extract publish_to_phone_number from publish#333
Merged
vieiralucas merged 1 commit intomainfrom Apr 13, 2026
Merged
refactor(sns): extract publish_to_phone_number from publish#333vieiralucas merged 1 commit intomainfrom
vieiralucas merged 1 commit intomainfrom
Conversation
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.
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
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
Summary by cubic
Extracted the SMS
PhoneNumberpath frompublishintopublish_to_phone_numberinfakecloud-snsto simplify the publish flow. No behavior change.publish_to_phone_number.publishnow delegates whenPhoneNumberis present; topic fan-out stays inline.Written for commit 27a71b4. Summary will update on new commits.