Skip to content
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

Too many retries don't cause client to raise #28

Open
padarom opened this issue May 19, 2020 · 0 comments
Open

Too many retries don't cause client to raise #28

padarom opened this issue May 19, 2020 · 0 comments

Comments

@padarom
Copy link

padarom commented May 19, 2020

In our case the client keeps receiving responses with code 401. The FCM authentication works fine, but the configured APNS key doesn't seem to be working temporarily, so the FCM servers aren't able to properly authenticate with Apple and just bubble the 401 back to the client. The response includes that information, but since it also happens to be a 401 it just keeps trying to refresh its access token until it times out.

if response_successful?(response) || retry_count > max_retry_count
return message_from_response(response)
elsif response.code == "401"
refresh_access_token_info
else
raise Error.from_response(response)
end

{"error"=>
  {"code"=>401,
   "message"=>"Auth error from APNS or Web Push Service",
   "status"=>"UNAUTHENTICATED",
   "details"=>
    [{"@type"=>"type.googleapis.com/google.firebase.fcm.v1.FcmError",
      "errorCode"=>"THIRD_PARTY_AUTH_ERROR"}]}}

I'd expect the client to raise if the final retry wasn't successful, but as it stands it just returns the above error. Is there a specific reason why that's not the case or would a PR that changes this behavior be welcome?

@padarom padarom changed the title Too many retries doesn't cause client to raise Too many retries don't cause client to raise May 19, 2020
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

No branches or pull requests

1 participant