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

Cleanup some handler code #651

Merged
merged 1 commit into from
Oct 3, 2023
Merged

Cleanup some handler code #651

merged 1 commit into from
Oct 3, 2023

Conversation

rowanseymour
Copy link
Member

No description provided.

if err != nil {
return status, err
}
jsonBody := jsonx.MustMarshal(payload)
Copy link
Member Author

Choose a reason for hiding this comment

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

these are structs we control... and we know they can't fail marshaling

@@ -719,16 +720,13 @@ func (h *handler) sendFacebookInstagramMsg(ctx context.Context, msg courier.MsgO
// include any quick replies on the last piece we send
if part.IsLast {
for _, qr := range msg.QuickReplies() {
payload.Message.QuickReplies = append(payload.Message.QuickReplies, messenger.QuickReply{qr, qr, "text"})
payload.Message.QuickReplies = append(payload.Message.QuickReplies, messenger.QuickReply{Title: qr, Payload: qr, ContentType: "text"})
Copy link
Member Author

Choose a reason for hiding this comment

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

linter wasn't happy

@@ -1094,15 +1092,12 @@ func (h *handler) sendWhatsAppMsg(ctx context.Context, msg courier.MsgOut, clog
return status, nil
}

func requestWAC(payload whatsapp.SendRequest, accessToken string, status courier.StatusUpdate, wacPhoneURL *url.URL, zeroIndex bool, clog *courier.ChannelLog) (courier.StatusUpdate, error) {
Copy link
Member Author

Choose a reason for hiding this comment

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

redundant passing in status and returning it

@codecov
Copy link

codecov bot commented Oct 3, 2023

Codecov Report

Merging #651 (89c7fa5) into main (a8dbe8e) will increase coverage by 0.29%.
The diff coverage is 95.83%.

@@            Coverage Diff             @@
##             main     #651      +/-   ##
==========================================
+ Coverage   73.95%   74.24%   +0.29%     
==========================================
  Files          99       99              
  Lines       13184    13147      -37     
==========================================
+ Hits         9750     9761      +11     
+ Misses       2729     2697      -32     
+ Partials      705      689      -16     
Files Coverage Δ
handlers/bandwidth/handler.go 70.77% <100.00%> (+1.74%) ⬆️
handlers/dialog360/handler.go 81.79% <100.00%> (+0.54%) ⬆️
handlers/facebook_legacy/handler.go 84.59% <100.00%> (+0.74%) ⬆️
handlers/firebase/handler.go 84.74% <100.00%> (+2.24%) ⬆️
handlers/freshchat/handler.go 67.94% <100.00%> (+1.49%) ⬆️
handlers/messagebird/handler.go 73.40% <100.00%> (+1.29%) ⬆️
handlers/playmobile/handler.go 81.44% <100.00%> (+2.44%) ⬆️
handlers/rocketchat/handler.go 73.61% <100.00%> (+3.34%) ⬆️
handlers/twitter/handler.go 70.13% <100.00%> (+0.82%) ⬆️
handlers/wavy/handler.go 83.33% <100.00%> (+3.60%) ⬆️
... and 3 more

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

@rowanseymour rowanseymour merged commit 0786149 into main Oct 3, 2023
7 checks passed
@rowanseymour rowanseymour deleted the handler_tweaks branch October 3, 2023 23:05
@github-actions github-actions bot locked and limited conversation to collaborators Oct 3, 2023
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.

1 participant