Skip to content

Refactor trigger(Batch) and introduce sendToUser #329

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 1 commit into from
May 31, 2022
Merged

Conversation

sonologico
Copy link
Contributor

Description

Refactor trigger functions to reduce code duplication and introduce sendToUser functions

CHANGELOG

  • [ADDED] sendToUser and sendToUserAsync functions
  • [DEPRECATED] deprecate internal functions make_request and make_batch_request that were exposed as public

}

// json_encode might return false on failure
if (!$data_encoded) {
Copy link

Choose a reason for hiding this comment

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

nit you may wrap getting data_encoded in the separate function to increase readability

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This is copying from the previous implementation. So I'll leave it as is in this PR, but it could be done in a separate PR. There are some other long functions in this file.

@sonologico sonologico merged commit ce45184 into master May 31, 2022
@sonologico sonologico deleted the send-to-user branch June 2, 2022 07:34
Comment on lines +1066 to +1070
if (count($channel_values) == 1) {
$post_params['channel'] = $channel_values[0];
} else {
$post_params['channels'] = $channel_values;
}
Copy link

Choose a reason for hiding this comment

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

This is a backward breaking change. The payload has changed from being channel in case only one channel is supplied. This has always been channels no matter the number of channels provided.

Ref: #351

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I'm missing something. Can you help me understand how this breaks things for you? This payload is sent to the pusher server and it accepts both.

Copy link

Choose a reason for hiding this comment

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

You are right, this only applies to custom servers.

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.

3 participants