bugsnag / bugsnag-laravel

BugSnag notifier for the Laravel PHP framework. Monitor and report Laravel errors.
https://docs.bugsnag.com/platforms/php/laravel/
MIT License
874 stars 129 forks source link

Delay session delivery to "after the response is sent" #513

Open lezhnev74 opened 1 year ago

lezhnev74 commented 1 year ago

Currently the delivering phase of sessions (SessionTracker::deliverSessions) is built-in to the startSession function at RouteMatched event which adds unnecessary overhead to some lucky clients.

I understand that this "built-in" behaviour comes from underlying "bugsnag/bugsnag" package and I don't see a way how to change that from this package.

My point is to delay session delivery to after the response is sent. This can be done, as one example, by putting deliveryng code to app()->terminating(<call deliver sessions>) which will be invoked after the request is served.

What do you think?

johnkiely1 commented 1 year ago

Hi @lezhnev74, Thanks for the suggestion. Seems like a reasonable approach, we will definitely give it some more thought as soon as priorities allow.