Skip to content

Fixed error when sending pushes to one pushType #6

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
Mar 30, 2016

Conversation

leonluc-dev
Copy link
Contributor

Added check for empty devices sets when sending push notifications to
senders. This fixes and issue where the empty sets being processed by
the senders would throw several reference errors.

Fixes parse-community/parse-server#1245

Added check for empty devices sets when sending push notifications to
senders. This fixes and issue where the empty sets being processed by
the senders would throw several reference errors.
@codecov-io
Copy link

Current coverage is 87.02%

Merging #6 into master will increase coverage by +0.05% as of ffc916d

@@            master      #6   diff @@
======================================
  Files            5       5       
  Stmts          238     239     +1
  Branches        37      38     +1
  Methods          0       0       
======================================
+ Hit            207     208     +1
  Partial          1       1       
  Missed          30      30       

Review entire Coverage Diff as of ffc916d

Powered by Codecov. Updated on successful CI builds.

}
if(devices.length > 0)
{
if (!sender) {
Copy link
Contributor

Choose a reason for hiding this comment

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

can you use spaces instead of tabs and length 2 instead of 4?

@flovilmart
Copy link
Contributor

One small nit otherwise LGTM

} else {
sendPromises.push(sender.send(data, devices));
}
if(devices.length > 0)
Copy link
Contributor

Choose a reason for hiding this comment

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

can you use Array.isArray(devices) && devices.length > 0 instead? This way we'll completely eliminate any possible problems,

Replaced tabs with spaces
Added array check for device set
@leonluc-dev
Copy link
Contributor Author

Tabs have been replaced with spaces (length =2). And the Array.isArray() check has been added

@flovilmart flovilmart merged commit c8a76b4 into parse-community:master Mar 30, 2016
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.

Issue with sending pushes from Parse Server
3 participants