Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Message broadcast happens for non existent app id #142

Closed
sfolador opened this issue Apr 11, 2024 · 1 comment · Fixed by #143
Closed

Message broadcast happens for non existent app id #142

sfolador opened this issue Apr 11, 2024 · 1 comment · Fixed by #143
Assignees

Comments

@sfolador
Copy link

Reverb Version

v1.0.0-beta6

Laravel Version

11.3.1

PHP Version

8.2.13

Description

If an event is broadcast to a non existend app id an exception is correctly raised ( Illuminate\Broadcasting\BroadcastException Pusher error: No matching application for ID) but the event is broadcast anyway and connected clients will receive that event even if the clients are connected to another app ID.

I do not know if this is an expected behaviour or not.

The reverb server is hosted on Forge.

Laravel version is 11.3.1 but it was updated from 10, i do not know if this could be an important information for you.

Steps To Reproduce

  • Setup Reverb
  • Create an Event that is broadcast to a public channel
<?php

namespace App\Events;

use Illuminate\Broadcasting\Channel;
use Illuminate\Broadcasting\InteractsWithSockets;
use Illuminate\Contracts\Broadcasting\ShouldBroadcast;
use Illuminate\Foundation\Events\Dispatchable;
use Illuminate\Queue\SerializesModels;

class OrderShipmentStatusUpdated implements ShouldBroadcast
{
    use Dispatchable, InteractsWithSockets, SerializesModels;

    public function __construct(public $name)
    {
    }

    public function broadcastOn(): array
    {
        return [
            new Channel('orders'),
        ];
    }

}
  • Create a page that listens to that event
<script>
window.onload = function(){
    console.log("connect");
    Echo.channel('orders')
        .listen('OrderShipmentStatusUpdated', (e) => {
            // ...

            console.log(e);
            console.log("asdad");
     });
}
</script>
  • Dispatch the event and see that the webpage receives it correctly
  • Change the app id in the broadcasting Laravel app
  • Exception is raised but the web page will receive the event

You can see the whole flow in the video below.

Screen.Recording.2024-04-11.at.13.30.41.mov
@sfolador sfolador changed the title Message broadcast happens for non existend app id Message broadcast happens for non existent app id Apr 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants
@sfolador @driesvints @joedixon and others