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

Log in subscribers when broadcasting a subscription update #1306

Merged
merged 16 commits into from Apr 19, 2020

Conversation

stayallive
Copy link
Collaborator

@stayallive stayallive commented Apr 19, 2020

  • Added or updated tests
  • Added Docs for all relevant versions
  • Updated CHANGELOG.md

Fixes #1302.

Changes

Add a new interator used to iterator over subscription subscribers to restore the guard context when executing the GraphQL queries to broadcast to the subscribers.

Breaking changes

Might be considered a bugfix instead of a breaking change because auth()->user() is now set correctly to the subscriber user context when resolving subscription broadcasts.

@stayallive stayallive changed the title Add GuardContextSyncInterator to restore the guard context when resol… Add GuardContextSyncInterator to restore the guard context when resolving subscription queries Apr 19, 2020
@stayallive
Copy link
Collaborator Author

@spawnia this is my current plan for dealing with #1302, I'm missing tests and docs but I wanted to show this to see if this is a direction we can take or you'd like me to structure it differently.

@spawnia
Copy link
Collaborator

spawnia commented Apr 19, 2020

@stayallive that approach looks solid. I especially like that it is pluggable, so there is little risk in experimenting a little. I am totally fine with shipping it once we add tests, docs and some polish.

@stayallive
Copy link
Collaborator Author

Do you want to add a configuration option to enable this behaviour so we can ship it without enabling it at all and if there are no issues we can enable it by default on v5 and remove the config options for it?

@spawnia
Copy link
Collaborator

spawnia commented Apr 19, 2020

Do you want to add a configuration option to enable this behaviour so we can ship it without enabling it at all and if there are no issues we can enable it by default on v5 and remove the config options for it?

I don't see a need for that, since this should work out of the box. If it needs a bugfix, we can add that. In case someone needs to revert to the old behaviour, they can rebind the interface.

@stayallive stayallive marked this pull request as ready for review April 19, 2020 15:42
# Conflicts:
#	CHANGELOG.md
#	composer.json
Copy link
Collaborator

@spawnia spawnia left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Overall this looks really solid. I like the attention to detail, good naming and descriptive comments.

@spawnia spawnia changed the title Add GuardContextSyncInterator to restore the guard context when resolving subscription queries Log in subscribers when broadcasting a subscription update Apr 19, 2020
@spawnia spawnia merged commit cad2d42 into master Apr 19, 2020
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

Successfully merging this pull request may close these issues.

User authentication context not restored in subscription broadcast
3 participants