Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add send error for channel and contact pair limit hit that allow retr… #805

Merged
merged 2 commits into from
Nov 25, 2024

Conversation

norkans7
Copy link
Contributor

…ying the message

Copy link

codecov bot commented Nov 25, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 74.41%. Comparing base (9e07701) to head (3693fe4).

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #805   +/-   ##
=======================================
  Coverage   74.40%   74.41%           
=======================================
  Files         112      112           
  Lines       13493    13496    +3     
=======================================
+ Hits        10040    10043    +3     
  Misses       2718     2718           
  Partials      735      735           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.


🚨 Try these New Features:

@@ -1090,6 +1091,10 @@ func (h *handler) requestWAC(payload whatsapp.SendRequest, accessToken string, r
return courier.ErrResponseUnparseable
}

if slices.Index([]int{4, 80007, 130429, 131048, 131056, 133016}, respPayload.Error.Code) > 0 {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Matching the error codes https://developers.facebook.com/docs/whatsapp/cloud-api/support/error-codes#throttling-errors to all be marked as throttle error and we retry up to 3 times

Copy link
Member

Choose a reason for hiding this comment

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

this is odd way to check if x in y. Save the list of error codes as a global, then use slices.Contains

@@ -1090,6 +1091,10 @@ func (h *handler) requestWAC(payload whatsapp.SendRequest, accessToken string, r
return courier.ErrResponseUnparseable
}

if slices.Index([]int{4, 80007, 130429, 131048, 131056, 133016}, respPayload.Error.Code) > 0 {
Copy link
Member

Choose a reason for hiding this comment

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

this is odd way to check if x in y. Save the list of error codes as a global, then use slices.Contains

@rowanseymour rowanseymour merged commit d10f7e3 into main Nov 25, 2024
7 checks passed
@rowanseymour rowanseymour deleted the WAC-pair-limit-retry branch November 25, 2024 15:01
@github-actions github-actions bot locked and limited conversation to collaborators Nov 25, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants