santacruz
3 years ago

Event broadcasting not working with Pusher

Posted 3 years ago by santacruz

I would like to share an issue I have just experienced and already found the answer. But I am sure other people might run into this, so this is for documentation / Google.

I have configured my pusher broadcasting correctly and triggered the event but then – nothing. The event has not been broadcast. Nothing showed up in the Pusher debug console. I checked every piece of code over and over again, everything was set-up correctly.

Here's the issue: Homestead timing! Since I was testing this on my local machine, my Homestead environment server time has been slightly off to Pusher's (actual) server time. Note that every time your computer goes to sleep, the time gets put off. So this resulted in the following error:

Timestamp expired: Given timestamp (2016-07-08T11:52:30Z) not within 600s of server time (2016-07-08T12:11:38Z)

However I had a hard time debugging this, since the error response didn't get logged when using event broadcasting.

So you can either solve this by implementing some server time syncing or by performing a restart on homestead. Hopefully this will keep someone else from pulling their hair!

Please sign in or create an account to participate in this conversation.