champion0125 / apns-php

Automatically exported from code.google.com/p/apns-php
0 stars 0 forks source link

Doesn't reconnect on failure when sending a queue with more than 1 message #10

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1. Add 10 messages $apns->add($msg), where 1 (in the middle) will be with 
invalid token.
2. Send them $apns->send();

What is the expected output? What do you see instead?
Send 9 push messages successfully.
Instead, it sends only the messages before the bad token. And the others fail.

What version of the product are you using? On what operating system?
newest revision (78) of apns-php on debian.

Please provide any additional information below.
I don't really know if that's an issue, or i am doing something wrong, but it 
seems like it's an issue. When i do $apns->send(); after each message, it sends 
all 9 messages and reconnects automatically. But when i try to send multiple 
messages from 1 queue at once, it doesn't seem to reconnect ... And it's really 
A LOT faster when sending approximately 3000 push notifications to do send 
after adding all of them instead of doing send after each. When i do send after 
each, it takes almost an hour to send all of them... I also attached a file 
with logs.

Original issue reported on code.google.com by kuk...@gmail.com on 25 Dec 2010 at 11:25

Attachments:

GoogleCodeExporter commented 8 years ago
Are you sure you are using the revision 78?

I got this output (see attached file).

See sample_push_many.php at revision 83

Original comment by aldo.arm...@gmail.com on 25 Dec 2010 at 2:51

Attachments:

GoogleCodeExporter commented 8 years ago
Didn't you solve this somehow from revision 78 to 83? because i just clicked 
downloads and downloaded the latest available in there (yesterday) and now when 
i look there, the link to rev78 is not the same color as the others. if you 
know what i mean. it's the 'visited' color, so yes, im pretty sure. The second 
thing is, am not sure if it's because the invalid token. It only says: written 
xxx bytes instead of xxx, and then it writes this to the end of the queue. and 
when it's done, there's another queue and it seems to not reconnect at all, so 
it doesn't send the messages in the second queue... so it possibly can be for 
some other reason than invalid token maybe. The third thing i want to ask is, 
if it can be cause by something missing on my server. If yes, please let me 
know what.
I really like apns-php, and i want to use this in couple of my projects. hope 
you'll debug it somehow if it's a bug, and if it's not a bug, then sorry for 
reporting, but i didn't find any contact on you.
I looked on the sample_push_many.php example, and it seems im doing it just 
okay. Look at the log file.It's from today when i was trying to add all the 
messages from certain timezone, send it, and then the same from another 
timezone. So there are a lot of add()-s and only 7 send()-s. Hope it'll help. 
One more thing ... don't look at the time as im changing the timezones in the 
script. it can be tricky.

Original comment by kuk...@gmail.com on 25 Dec 2010 at 3:25

Attachments:

GoogleCodeExporter commented 8 years ago
I think there is a connection problem between your server and Apple push 
notification gateway so "Written 0 bytes instead of 222 bytes" without an error 
message (e.g. ERROR: Unable to send message ID 5: Invalid token (8)).

At the moment seems that apns-php is unable to recover from connection error. 
See issue 8.

Original comment by aldo.arm...@gmail.com on 25 Dec 2010 at 3:59

GoogleCodeExporter commented 8 years ago
hmm... i don't think that's a connection problem, because it happens everytime 
on certain tokens or devices or so, but maybe you are true. Are you goning to 
fix the issue with reconnecting due to lost connection? If yes, when ? :) and 
one more thing, as i said, it works as expected when i do ->send() after every 
message, but it lasts really a LOT. and it doesn't send the same message as if 
i run ->send() only once. so i don't think it's as you told. The only 
difference is, that when i ->send() it after each message, it DOES reconnect on 
fail, and if i don't, it doesn't. why ?

Original comment by kuk...@gmail.com on 25 Dec 2010 at 4:08