echo icon indicating copy to clipboard operation
echo copied to clipboard

Echo is incompatible with BROADCAST_CONNECTION=ably

Open omarcinkonis opened this issue 4 months ago • 2 comments

Echo Version

2.2.0

Laravel Version

12.25.0

PHP Version

8.4.11

NPM Version

PNPM 10.15.0

Database Driver & Version

No response

Description

I tried setting up broadcasting with Ably according to the docs: https://laravel.com/docs/12.x/broadcasting.#client-ably. After following all steps and debugging, I concluded that Laravel ably driver is incompatible with Echo.

The problem is:

  • Laravel ably driver broadcasts to private:broadcast (colon).
  • laravel-echo library subscribes to private-broadcast (hyphen).

In order to fix this, Echo should use colons when subscribing to Ably. For the purpose of confirming that this approach would work, I edited PusherConnector in Echo source locally. I replaced colons to hyphens and Echo started working as expected.

Steps To Reproduce

  1. Follow Laravel docs to setup broadcasting with Ably.
  2. Setup basic front-end for testing.
  3. Run the queue using sail artisan queue:work or similar.
  4. Set Pusher.logToConsole = true;.
  5. Test using the front-end. You will see that Ably does not return anything.
  6. Check front-end logs in the console. The subscribed endpoint uses a hyphen.
  7. Check Ably dev console using their web client. Laravel uses a colon to broadcast with BROADCAST_CONNECTION=ably.

omarcinkonis avatar Aug 25 '25 16:08 omarcinkonis

Hey there, thanks for reporting this issue.

We'll need more info and/or code to debug this further. Can you please create a repository with the command below, commit the code that reproduces the issue as one separate commit on the main/master branch and share the repository here?

Please make sure that you have the latest version of the Laravel installer in order to run this command. Please also make sure you have both Git & the GitHub CLI tool properly set up.

laravel new bug-report --github="--public"

Do not amend and create a separate commit with your custom changes. After you've posted the repository, we'll try to reproduce the issue.

Thanks!

crynobone avatar Sep 08 '25 13:09 crynobone

Hello,

Did you enable pusher compatibility on Ably's project settings?

eduPHP avatar Sep 08 '25 19:09 eduPHP