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

Event still broadcasts to Current User #7

Closed
feenx opened this issue May 26, 2016 · 4 comments
Closed

Event still broadcasts to Current User #7

feenx opened this issue May 26, 2016 · 4 comments

Comments

@feenx
Copy link

feenx commented May 26, 2016

So even though I've added $this->dontBroadcastToCurrentUser(); in the constructor of all my broadcasted events that I don't want to duplicate. It is still going out to the current user showing duplicates. It seems as though socket_id is being properly set to the session, as well as being sent out with the events.

Not sure if it's because of this or not, but during the Laravel Echo demo on Laracasts it was mentioned and showed that Echo does a /broadcasting/auth API call which is not occuring with my current setup. Is that only for private channels?

Oh and real quick within BroadcastServiceProvider I keep getting method "channel" not found. This is the error:

ErrorException in BroadcastManager.php line 281:
call_user_func_array() expects parameter 1 to be a valid callback, class 'Illuminate\Broadcasting\Broadcasters\PusherBroadcaster' does not have a method 'channel'

Of course I appreciate any help, I know this all pre-release.

@tlaverdure
Copy link
Contributor

@pfeiferchristopher not much is documented yet, but hopefully this helps:

  • Laravel looks for the header X-Socket-Id when using $this->dontBroadcastToCurrentUser(); to identify which user to not to send events to.
  • /broadcasting/auth is only used when authenticating a user for private or presence channels.
  • The method channel() no longer exists, use auth() instead with Laravel 5.3

@feenx
Copy link
Author

feenx commented May 27, 2016

@tlaverdure thanks for your reply!

I did see that X-Socket-Id must be in the header, but what I'm confused on is in the Laravel Echo demo on Laracasts it never showed him adding that manually? I'm also confused as to where I'd have to add that header in. Is it within Echo itself?

@Francismori7
Copy link

@feenx
Copy link
Author

feenx commented Jun 26, 2016

laravel/framework#13929

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants