krakenjs / post-robot

Cross domain post-messaging on the client side using a simple listener/client pattern.
Apache License 2.0
741 stars 92 forks source link

Missing timeout on function #76

Open barnesicle opened 5 years ago

barnesicle commented 5 years ago

There is no documentation on how to set a timeout with the on function. I was looking through the code and can not seem to find it. I think there was before. It looks like this with removed with the removal of the global config in one of the later versions. I get "No ack for postMessage myEventName in http://localhost:8080 in 2000ms".

Please let me know if there is a way to set this timeout value.

Thanks.

bluepnume commented 5 years ago

If you're getting this error, it probably means that post-robot is not loaded in the other window. The ack should be sent immediately; if it takes longer that 2000ms that means something is probably very wrong.

barnesicle commented 5 years ago

This was configurable before though wasn't it? I can get it by using chromes network limiter with slow 3G selected.

mangatinanda commented 4 years ago

I am facing this issue too. Please let us know if there is a way to set this value higher than 2000ms. @bluepnume

barnesicle commented 4 years ago

We ended up writing a recursive function that kept retrying n amount of times.

mangatinanda commented 4 years ago

Aww... that is not an ideal solution for us. We are rendering an iframe in a huge ember app already. @bluepnume please let us know if there is a way to set higher timeout value. This issue is happening sporadically in our case.