Lighthouse: Echo subscription driver: Bug, Inconsistency, Missing documentation

Created on 4 Feb 2021  路  9Comments  路  Source: nuwave/lighthouse

Describe the bug
I was trying to figure out the subscription with the echo driver. I found the following things are wrongly done.

But when broadcasting, it then broadcasts to a presence channel. which prepends presensce- to the channel making presence-private-lighthouse-*. So, it should always be handled as a presence channel? https://github.com/nuwave/lighthouse/blob/dba839e85631f2262c12d7e5c96b8b25048001f6/src/Subscriptions/Events/EchoSubscriptionEvent.php#L29-L32

Lighthouse Version: * v5.1.0

bug

Most helpful comment

Where did you find that expired link? The on in the readme works fine.

That is because i just updated it 馃槈

All 9 comments

@stayallive @alberthaff what do you think?

It looks like there are some things going wrong in the Echo driver indeed.

The channel name and it using a presence channel are from what I can tell wrong indeed (the channel name with a private channel would also not work because it will prepand another private- to it so that needs some changing).

And the ShouldBroadcast causes the broadcast to be queued again basically double queuing Laravel Echo messages.

The event name is confusing but not a bug but would be nice to keep them in sync.

To broadcast a message through the echo driver, it requires to install illuminate/broadcasting package when using Laravel. If using pusher, it's not required. It's not mentioned in the documentation.

This one I'm not sure, because for Pusher you also need that package for it to register Pusher in the container, but you could do that manually I guess. But this is a Lumen "issue".

@ssi-anik I think we could all agree we'd be happy to get a PR solving the issues since you seem to be actively using it with Laravel Echo, would you be up for that?

@stayallive Yes, I can help with it. But I lack the knowledge of testing. So, I can send a PR but if you're looking for testing, then you'll have to help me out.

Just look at the existing tests related to subscriptions and consider https://github.com/nuwave/lighthouse/blob/master/CONTRIBUTING.md.

I'm interested in working on this issue. I need some time to start working on it. If someone starts before me, then please give a heads-up here. And, the slack invitation has expired. I Will ask a few questions when I start working.
Thanks.
image

This invite link should work: Slack invite.

Where did you find that expired link? The on in the readme works fine.

Where did you find that expired link? The on in the readme works fine.

That is because i just updated it 馃槈

Sorry for the late reply.
I have no experience with the echo driver. But something definitely seems wrong with the channel names and queuing.

Regarding the docs - i actually can't find anything about the echo driver, except the client implementation. If we are supporting multiple drivers, maybe we should add a section about the individual drivers, their requirements and client-implementations.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

spawnia picture spawnia  路  4Comments

let-aurn picture let-aurn  路  3Comments

spawnia picture spawnia  路  3Comments

souljacker picture souljacker  路  3Comments

caizhigang97 picture caizhigang97  路  3Comments