Skip to content

useEchoNotification does not trigger my callback #467

Description

@DhiaBen20

Echo Version

2.2.6

Laravel Version

12.0

PHP Version

8.4.15

NPM Version

11.7.0

Database Driver & Version

sqlite

Description

I have two hooks listening to the same notification channel and logging a message when a notification is received.

const channel = `App.Models.User.${auth.user.id}`;

useEchoNotification(channel, () => console.log('user notification channel using useEchoNotification'));

useEcho(
    channel,
    '.Illuminate\\Notifications\\Events\\BroadcastNotificationCreated',
    () => console.log("user notification channel using useEcho"),
);

I expect to see two logs in the console, but only the second one (useEcho) is logged.

Steps To Reproduce

A minimal reproduction is available here: https://github.com/DhiaBen20/laravel-echo-bug-report

Steps:

  1. Clone the repository
  2. Install dependencies
  3. cp .env.example .env
  4. php artisan key:gen
  5. php artisan migrate
  6. php artisan reverb:install
  7. composer run dev
  8. php artisan reverb:start
  9. login and go to dashboard page and open the console.
  10. inside tinker notify the currently authenticated user User::first()->notify(new \App\Notifications\Test) and you will see one log printed on the console instead of two

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions