I found out that those handlers can not be fully trusted. We are using channel api for few month already and experienced a whole bunch of different problems:
the handlers may not be called or called with huge delays, so that even their order is wrong (the client has long ago refreshed the token and is connected to another channel already and then bang disconnect for the previous one)..
the channel may be connected, but may not receive any messages at all...
We are using many precautions, for example our clients notify server themselves when channel is created and opened, then server tries to send an ack message and
only if it goes through the channel is considered as connected. Same with disconnect, we try to notify server ourselves when users logout or close windows.
So far based on my experience I'm afraid this is the only way to work with channels, I mean expect everything to fail (or can I say this about gae in general? or maybe all highly distributed systems :))...
PS Btw star this issue please - batch send method :)