Skip to content

Fix person_fn not being called when session not empty #12

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

Merged
merged 1 commit into from
Sep 4, 2017
Merged

Fix person_fn not being called when session not empty #12

merged 1 commit into from
Sep 4, 2017

Conversation

philbates35
Copy link

@philbates35 philbates35 commented Aug 29, 2017

This PR fixes the broken person_fn as reported in #1 and #3, but
as 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/rollbar
package 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, will
always 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.

Currently, when the session is not empty, this package always sets a
"person" entry in the rollbar config, which results in the rollbar/rollbar
package ever 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, will
always be set when the session is not empty.

Revert back to the behaviour originally found in RollbarLogHandler in
42920e5 before it was refactored in 8988c22 which introduced this bug.
As 42920e5 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.
@ArturMoczulski ArturMoczulski merged commit 4a62239 into rollbar:master Sep 4, 2017
@ArturMoczulski
Copy link

@philbates35 thanks for your work on this. Merged now.

This was referenced Sep 4, 2017
@philbates35 philbates35 deleted the person-function-fix branch September 4, 2017 10:58
@jnbn
Copy link

jnbn commented Sep 16, 2017

@ArturMoczulski can you please also tag?

@ArturMoczulski
Copy link

@jnbn Done. This is included in tag v2.2.0

@jnbn
Copy link

jnbn commented Sep 17, 2017

Thanks @ArturMoczulski

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