Fix person_fn not being called when session not empty #12
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR fixes the broken
person_fn
as reported in #1 and #3, butas they seem pretty old inactive PRs with broken tests, I thought I'd
submit a new one that can hopefully be merged soon, as this bug is
stopping us from upgrading to the newer versions of this library.
I decided to go for the safest option, which is to revert to the old existing
logic when
person_fn
still worked.Explanation
Currently, when the session is not empty, this package always sets a
person
entry in the rollbar config, which results in the rollbar/rollbarpackage never caling the
person_fn
.The rollbar/rollbar package only calls
$config['person_fn']
when the$config['person']
doesn't already exist, which as stated above, willalways be set when the session is not empty.
Revert back to the behaviour originally found in RollbarLogHandler before
it was refactored in 8988c22 which introduced this bug. As it previously used
an older version of the rollbar/rollbar library, this commit doesn't revert the
changes back exactly, but is the equivalent changes for the latest version
of the rollbar/rollbar library API.
Add a regression test that currently fails on master branch but passes
with these canges to
RollbarLogHandler
.