The Wayback Machine - https://web.archive.org/web/20201108140520/https://github.com/bugsnag/bugsnag-laravel/pull/378
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

Fixed the storage functions #378

Open
wants to merge 2 commits into
base: 2.18
from
Open

Fixed the storage functions #378

wants to merge 2 commits into from

Conversation

@Cawllec
Copy link
Contributor

@Cawllec Cawllec commented Jan 8, 2020

Original PR by @GrahamCampbell found at #376

Goal

Fixed the storage functions. Closes bugsnag/bugsnag-php#557.

@Cawllec Cawllec requested a review from GrahamCampbell Jan 8, 2020
@@ -392,7 +394,9 @@ protected function setupSessionTracking(Client $client, $endpoint, $events)

$genericStorage = function ($key, $value = null) use ($cache) {
if (is_null($value)) {
return $cache->get($key, null);
$result = $cache->get($key, []);

This comment has been minimized.

@Cawllec

Cawllec Jan 8, 2020
Author Contributor

This is what's calling the test failure. The session tracker will utilise whatever is returned from this method in whatever format it's in. Previously this being null was fine by default, as we checked for nulls where necessary. We don't check in the SessionTracker (but maybe we should), as $a - null = $a.

Unfortunately the error being thrown isn't exactly visible due to being deep in docker.

@Cawllec
Copy link
Contributor Author

@Cawllec Cawllec commented Jan 8, 2020

I suggest we solve this in the PHP notifier, as that could be a bit more robust in how it handles values with ambiguous types.

For instance there's a null check here,
but not one here which should be added.

Likewise although it shouldn't need it in the current implementation in Laravel, it would be good to guard here as well.

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

Successfully merging this pull request may close these issues.

None yet

2 participants
You can’t perform that action at this time.