-
-
Notifications
You must be signed in to change notification settings - Fork 438
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
Subscription send only to others #2298
Conversation
Co-authored-by: Benedikt Franke <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you add a test?
Also, please update docs/master
and do not change docs/5
Co-authored-by: Benedikt Franke <[email protected]>
Co-authored-by: Benedikt Franke <[email protected]>
Co-authored-by: Benedikt Franke <[email protected]>
Co-authored-by: Benedikt Franke <[email protected]>
Co-authored-by: Benedikt Franke <[email protected]>
Co-authored-by: Benedikt Franke <[email protected]>
Co-authored-by: Benedikt Franke <[email protected]>
Co-authored-by: Benedikt Franke <[email protected]>
Co-authored-by: Benedikt Franke <[email protected]>
Co-authored-by: Benedikt Franke <[email protected]>
Thanks for reviewing this and sorry about the docs, fixed. I couldn't find any tests for filtering if there is one please tell me where it is then I probably can write a test for this based on that |
Not sure if there are any tests for it. Try adding something in https://github.com/nuwave/lighthouse/tree/master/tests/Integration/Subscriptions. |
Thanks that's ok, I'll write one for storage of socket_id that should be good enough. |
All done test was added too, tested locally all passed, did cs-fixer and php stan locally no errors. The errors in the CI seem to be unrelated to the commits you might wanna check on them. |
Sure you're right, I don't get that locally different php version or dependencies maybe /**
* X-Socket-ID header passed on the subscription query.
*/
public string|array|null $socket_id; This would fix it for php 8 I think? But it will break it for php 7, what do you suggest? Would this fix it for all versions? Works for me: /**
* X-Socket-ID header passed on the subscription query.
* @var string|null|array<mixed>
*/
public $socket_id; I'm not really good with different php versions yet I usually use one |
@spawnia Yep that fixed it, the rest is all:
eg: https://github.com/nuwave/lighthouse/actions/runs/4176052100/jobs/7231826956 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
good test
tests/Integration/Subscriptions/Storage/RedisStorageManagerTest.php
Outdated
Show resolved
Hide resolved
Merging |
@spawnia Thanks for working on this with me I enjoy doing PRs with you! |
Thanks for the contribution! |
A fix for #2293
Changes
Subscriptions can now be filtered via
$subscriber->socket_id
andrequest()->header("x-socket-id")
, which is similar to what https://laravel.com/docs/9.x/broadcasting#only-to-others does.Breaking changes
Nope.