edgurgel/poxa

client events not working on presence channel

tonygaetani opened this issue · 9 comments

I'm having trouble dropping in poxa as a replacement for slanger/pusher. I'm using @SLAMPER's easy_poxa image and passing in my configuration as environment variables. I am setting the port, appId, key, secret and web_hook. My apps can authenticate with poxa, but when I attempt to send a client event nothing happens. I can see the clients sending the event, and the pusher-js/node library calling trigger with the event, but I don't see any traffic arriving at poxa and I don't see the events get through to the other clients. In the poxa README it says features include clientEvents, is there some configuration or something I'm missing? Do I need to enable clientEvents like in production pusher?

Just to clarify I don't think there's anything wrong with poxa, but I've spent hours trying to get it running as a drop-in replacement for slanger and I'm reaching out here because I'm out of ideas. Again, the subscriptions/authentication works fine and I can see that in the poxa log, but triggering client events on a presence channel is not working. Any ideas why that would be?

Thanks in advance

Thanks for opening an issue. I will investigate this later. I usually test these features with an example app like https://github.com/pusher-community/pusher-presence-demo (but this one specifically looks pretty old :P)

Thanks, I saw that in the README, I'll see if I can get it working with my local poxa.

Also, I should have mentioned that I am using a fork of easy_poxa, so maybe it's related to how I'm setting the poxa.web_hook configuration url, but it seems fine to me.

here's the code to pass poxa.web_hook to the docker container
6RiverSystems/easy_poxa@b92aa7f

I'm using docker ... -e POXA_WEB_HOOK='http://localhost:3100/api/pusher/event' ... and I made sure that my docker container can at least make an http GET to that address

is this valid usage of poxa.web_hook?
poxa.web_hook = "http://localhost:3100/api/pusher/event"

is it supposed to be an array or something else?

edit - I'm not familliar with elixir or erlang but it looks like web_hook is an atom which is more or less a string constant so I think the above is okay... unless it needs to be :http://localhost:3100/api/pusher/event instead of "http://localhost:3100/api/pusher/event" (I doubt it)

also I don't see "Sending webhook request." being printed in the logs

Hm so just to be clear, the problem is with web hooks and client events?

the problem is with client events. Currently all of my apps and services can connect to poxa and subscribe to a presence channel and they even receive the pusher:subscription_succeeded event, but when they trigger client events on the presence channel nothing seems to happen. I brought up the web_hooks because I made a change to easy_poxa involving setting the poxa.web_hook config and I thought maybe that was related to my problem

Oh I see! Cool gotcha. I will give it a go later today. Thanks for the detailed bug report

I wish I had more specific info for you because I really don't think it's a bug in poxa I'm more just asking for help to figure out what I'm doing wrong.

I should be able to send client events over a presence channel right? In the end that's all my app really does. There are two js clients running in the browser and 3 js clients running as back-end nodejs services. The two running in the browser appear to see each other's client events (I can see Pusher : event recd : ... in the browser logs) but the poxa container doesn't print any messages (which is probably fine) and most importantly the back-end services never see the client events from the browser at all.

Oh hey so what I did was: used the pusher presence demo with master poxa and client events are being sent. I suggest you to watch the console page to see what's going on:

poxa_console

Also maybe investigate a way to print out whatever the client receives somehow (maybe a verbose configuration?)

Also try not using the docker image to exclude this other variable?

@edgurgel I haven't been working on this and probably won't. I suspect that my webhooks were not properly configured, but I never got to the bottom of it. I do not suspect that this is a bug in poxa. Thanks for looking into it and helping me out.