parse-server-modules / parse-server-sns-adapter

Parse Server SNS Adapter
18 stars 14 forks source link

Re-Enable Endpoints before sending push and allow sending push to Topic #6

Open benishak opened 8 years ago

benishak commented 8 years ago

Amazon SNS will set Endpoint to false when a notification service indicates to Amazon SNS that the endpoint is invalid even if it temporarily fail. We need to set it back to true

rogerhu commented 8 years ago

Tests are failing:

1) SNSPushAdapter can send SNS Payload
  Message:
    Error: Timeout - Async callback was not invoked within timeout specified by jasmine.DEFAULT_TIMEOUT_INTERVAL.
  Stack:
    Error: Timeout - Async callback was not invoked within timeout specified by jasmine.DEFAULT_TIMEOUT_INTERVAL.
        at Timer.listOnTimeout (timers.js:92:15)
2) SNSPushAdapter errors sending SNS Payload to Android and iOS
  Message:
    Error: Timeout - Async callback was not invoked within timeout specified by jasmine.DEFAULT_TIMEOUT_INTERVAL.
  Stack:
    Error: Timeout - Async callback was not invoked within timeout specified by jasmine.DEFAULT_TIMEOUT_INTERVAL.
        at Timer.listOnTimeout (timers.js:92:15)
3) SNSPushAdapter can send to APNS with multiple identifiers
  Message:
    Expected undefined to equal '{"APNS_SANDBOX":"{}"}'.
  Stack:
    Error: Expected undefined to equal '{"APNS_SANDBOX":"{}"}'.
        at /home/travis/build/parse-server-modules/parse-server-sns-adapter/spec/SNSPushAdapter.spec.js:388:34
        at process._tickDomainCallback (node.js:407:9)

Is the right action to re-enable right away? Are there better errors to distinguish between a network error, bad cert, etc.?

flovilmart commented 8 years ago

Are they passing on your machine? Also hosting the tests to report the errors would be noce

benishak commented 8 years ago

I didn't write the test thats why it is failing. I will try to change it when I got time. Otherwise I'm already using this on production and work as expected.

It is not necessary to check the cause of disabling the endpoint as if it would fail again you will get an error back. You need to reenable it to know what cause the failing

flovilmart commented 8 years ago

If the tests are failing, it's usually because that something that wasn't supposed to change mas changed....

benishak commented 8 years ago

Yeah the callback inside sendToSNS has changed. The old callback is being executed insode another callback that enable the endpoint.