Skip to content

Only format ScheduledDateTime if it has been set when generating message request data #20

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

Merged
merged 2 commits into from Jan 23, 2018

Conversation

raja
Copy link
Contributor

@raja raja commented Jan 22, 2018

When generating request data for a message, do not attempt to format the message param's ScheduledDateTime from message if it hasn't been set.

…the message param's ScheduledDateTime from message if it hasn't been set
@raja
Copy link
Contributor Author

raja commented Jan 22, 2018

This resolves message delivery latency issues as the ScheduledDateTime was being sent in the message request regardless of weather ScheduledDateTime was explicitly.

Copy link
Contributor

@azmb azmb left a comment

Choose a reason for hiding this comment

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

Hi Raja, thanks for your contribution!

message.go Outdated
@@ -102,12 +102,16 @@ func requestDataForMessage(originator string, recipients []string, body string,
} else {
request.MClass = 1
}

if params.ScheduledDatetime.IsZero() == false {
Copy link
Contributor

Choose a reason for hiding this comment

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

To make it consistent with our existing code base, would you mind simplifying if statement:
if !params.ScheduledDatetime.IsZero() {

@azmb azmb merged commit 84c39fa into messagebird:master Jan 23, 2018
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.

2 participants