laravel / reverb

Laravel Reverb provides a real-time WebSocket communication backend for Laravel applications.
https://reverb.laravel.com
MIT License
1.05k stars 76 forks source link

[1.x] Allows for disconnections when broadcasting to others #122

Closed cryptoprof closed 5 months ago

cryptoprof commented 5 months ago

Probably will fix issue with the Exception when use toOthers()

Resolves #121

taylorotwell commented 5 months ago

Probably? 😅

cryptoprof commented 5 months ago

Probably? 😅

After several years of programming, I often find that code has two quantum states - it works perfectly on the developer's computer, but on the tester's and user's computers, it may or may not work =) When I'm editing someone else's code, especially that of people smarter than me, it often turns out to be not a bug, but a feature.

joedixon commented 5 months ago

This PR does indeed protect against a potential issue when using toOthers in the event the connection you wish to ignore has disconnected before the event has been broadcasted.

I have updated the formatting a little and introduced a test.

RTippin commented 5 months ago

I can confirm that all of the intermittent Pusher 500 errors I have been observing occur when using toOthers and the client has already left the channel / refreshed entire screen, by the time the job is picked up and processed.