-
Notifications
You must be signed in to change notification settings - Fork 205
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
Auto Retry retries when it should not #145
Comments
This is completely correct! It wouldn't be a breaking change, either. If you have the time, please make a PR for this :) I imagine some change inside Sender#send: https://github.com/ToothlessGear/node-gcm/blob/master/lib/sender.js#L95 |
@hypesystem The line has changed since then due to other commits =( A cool trick I learned for the next time you want to link to a specific line in a file: Click the line in the file on GitHub, then press
It won't change as the |
Cool :) The fix should probably be somewhere in here: Lines 192 to 199 in e71405c
|
@hypesystem Currently, in the lines you highlighted, we retry no matter what. I think we need to return a flag in What do you think? In addition, we should not retry when we receive a |
Are there any other cases than The status codes (ie. |
@hypesystem Yes. Any 4xx is a client error and we should not retry. |
The easy solution would then be to match the status code and not retry if it is a number The status code is returned as the |
@hypesystem the On Sun, Dec 13, 2015, 12:49 Niels Abildgaard [email protected]
|
Matching on some set propery would be a cleaner solution, yes. But I think the responsibility for deciding whether or not we should retry should be in I think the solution with returning something useful (like a |
While we reviewing the retry code, it might be a good idea to implement using the Retry-After header in 5xx error cases instead of configured backoff delay. Spec can be found here: https://developers.google.com/cloud-messaging/http-server-ref |
@chris-rudmin Good idea. There is already an open issue about |
@hypesystem So should we just check if the |
@eladnava that is what I would suggest 😄 |
Submitted the PR =) @hypesystem |
Fixed in your PR @eladnava 😄 |
On 4xx client errors, it does not make sense to retry because our input is invalid. The server will reject with the same error if we try with the same input.
The text was updated successfully, but these errors were encountered: