Giter VIP home page Giter VIP logo

Comments (7)

edamov avatar edamov commented on May 24, 2024

It is hard to fix such error. Maybe the problem is on apple server side.
The only way I see is to add try/catch block and send request again in case of error. You can implement it on your side.
But also I may try to add this logic in library. Can you somehow store the whole response (status code, headers, body) from APNS and send me?

from pushok.

algesiaResidue avatar algesiaResidue commented on May 24, 2024

unfortunatly, curl http code is 0, thus throwing this exception in Client.php line 161, and there is no valid response.

from pushok.

algesiaResidue avatar algesiaResidue commented on May 24, 2024

maybe adding a retry function when curl get code 0 is a good idea.

from pushok.

dlucian avatar dlucian commented on May 24, 2024

But then, since the whole sending crashes on one timeout, one would need to check which notifications where sent and re-try the sending with just the ones that were not sent, right?

Which can't be done, since Client::push() doesn't return the responses anymore, but throws instead. So we don't know which notifications were sent and which not. Or am I missing something?

from pushok.

algesiaResidue avatar algesiaResidue commented on May 24, 2024

But then, since the whole sending crashes on one timeout, one would need to check which notifications where sent and re-try the sending with just the ones that were not sent, right?

Which can't be done, since Client::push() doesn't return the responses anymore, but throws instead. So we don't know which notifications were sent and which not. Or am I missing something?

You can't just throw this exception, but handle it yourself instead. When curl http code got 0, you should add that notification to multi curl handler again to be sent later.

from pushok.

dlucian avatar dlucian commented on May 24, 2024

But then, since the whole sending crashes on one timeout, one would need to check which notifications where sent and re-try the sending with just the ones that were not sent, right?
Which can't be done, since Client::push() doesn't return the responses anymore, but throws instead. So we don't know which notifications were sent and which not. Or am I missing something?

You can't just throw this exception, but handle it yourself instead. When curl http code got 0, you should add that notification to multi curl handler again to be sent later.

No, the Client class throws \Exception, not me. And when it it's thrown, there's no list of successfully sent notifications, so I don't know which to retry.

from pushok.

algesiaResidue avatar algesiaResidue commented on May 24, 2024

You can rewrite this method, and add retry mechanism. I just did this, and the error never affected my pushing project again lol.

from pushok.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.