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

fix events with ShouldBroadcastNow #623

Merged
merged 1 commit into from
May 6, 2019
Merged

fix events with ShouldBroadcastNow #623

merged 1 commit into from
May 6, 2019

Conversation

josiasmontag
Copy link
Contributor

This fix did not completely solve #412.

After dispatching an event with ShouldBroadcastNow the following entries are not correctly associated with the current request.

This PR solves this and disables the premature storing if an event with the sync driver was emitted.

@themsaid
Copy link
Member

themsaid commented May 5, 2019

@josiasmontag I'm not sure what's broken and this PR is trying to fix, what are the steps to re-produce?

@josiasmontag
Copy link
Contributor Author

class TestEvent implements ShouldBroadcastNow
{
}
class BroadcastTestController extends Controller
{
    public function index(Request $request)
    {
        DB::table('users')->get(); // recoded correctly
        event(new TestEvent());
        DB::table('users')->get() // recorded, but not associated to the current request
    }
}

The second query gets recorded but it does not show up in the "Queries" Tab on the Request detail page in Telescope. This PR solves it and the second query is correctly assigned to the current request.

@themsaid themsaid merged commit f17782d into laravel:master May 6, 2019
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.

3 participants