Skip to content

Echo is incompatible with BROADCAST_CONNECTION=ably #449

Description

@omarcinkonis

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.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions