Skip to content

[messages] require phone numbers uniqness - #266

Open
capcom6 wants to merge 2 commits into
masterfrom
messages/validate-phone-numbers-uniqness
Open

[messages] require phone numbers uniqness#266
capcom6 wants to merge 2 commits into
masterfrom
messages/validate-phone-numbers-uniqness

Conversation

@capcom6

@capcom6 capcom6 commented Aug 17, 2026

Copy link
Copy Markdown
Member

Greptile Summary

The PR enforces recipient phone-number uniqueness after normal validation and improves client-facing duplicate-ID and validation errors.

  • Rejects repeated normalized phone numbers during message preparation.
  • Returns concise validation and duplicate-ID responses through the third-party API.
  • Adds handler and end-to-end coverage for uniqueness and duplicate message IDs.
  • Updates generated OpenAPI wording and suppresses a planned FCM token deprecation warning.

Confidence Score: 5/5

The PR appears safe to merge because no blocking failure remains.

No blocking failure remains.

Important Files Changed

Filename Overview
internal/sms-gateway/modules/messages/service.go Normalizes recipients and rejects duplicate resulting phone-number strings before preparing the message.
internal/sms-gateway/handlers/messages/3rdparty.go Maps wrapped validation and duplicate-ID errors to concise client-facing HTTP responses.
internal/sms-gateway/handlers/messages/3rdparty_test.go Adds focused coverage for error status and response-message behavior.
test/e2e/messages_test.go Adds end-to-end coverage for duplicate recipients, distinct recipients, and duplicate message IDs.
go.mod Promotes testify to a direct test dependency and records its indirect dependencies.

Flowchart

%%{init: {'theme': 'neutral'}}%%
flowchart TD
    A[Message request] --> B[Validate and normalize phone numbers]
    B --> C{Normalized number already seen?}
    C -- Yes --> D[Return validation error]
    C -- No --> E[Record number]
    E --> F{More recipients?}
    F -- Yes --> B
    F -- No --> G[Prepare and enqueue message]
Loading

Reviews (5): Last reviewed commit: "[lint] ignore FCM Fid migration" | Re-trigger Greptile

@github-actions

github-actions Bot commented Aug 17, 2026

Copy link
Copy Markdown

🤖 Pull request artifacts

Platform File
🐳 Docker GitHub Container Registry
🍎 Darwin arm64 server_Darwin_arm64.tar.gz
🍎 Darwin x86_64 server_Darwin_x86_64.tar.gz
🐧 Linux arm64 server_Linux_arm64.tar.gz
🐧 Linux i386 server_Linux_i386.tar.gz
🐧 Linux x86_64 server_Linux_x86_64.tar.gz
🪟 Windows arm64 server_Windows_arm64.zip
🪟 Windows i386 server_Windows_i386.zip
🪟 Windows x86_64 server_Windows_x86_64.zip

@capcom6
capcom6 force-pushed the messages/validate-phone-numbers-uniqness branch from 58f450d to 69fa616 Compare August 18, 2026 01:21
@capcom6 capcom6 added the ready label Aug 19, 2026
@capcom6
capcom6 force-pushed the messages/validate-phone-numbers-uniqness branch from 69fa616 to 67c706b Compare August 20, 2026 00:53
@github-actions github-actions Bot removed the ready label Aug 20, 2026
@capcom6
capcom6 force-pushed the messages/validate-phone-numbers-uniqness branch from d0190ee to 65f863f Compare August 21, 2026 03:54
@capcom6 capcom6 added the deployed The PR is deployed on staging label Aug 21, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

deployed The PR is deployed on staging

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant