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 scrubber #112

Merged
merged 5 commits into from
Apr 21, 2017
Merged

Fix scrubber #112

merged 5 commits into from
Apr 21, 2017

Conversation

MichaelMackus
Copy link
Contributor

Branch split of #111, specifically to fix the DataBuilder::scrub method.

@MichaelMackus
Copy link
Contributor Author

MichaelMackus commented Mar 28, 2017

Just to be clear, from what I could tell from initial usage the "scrubFields" param was incredibly broken. It seems like it just ended up scrubbing all the fields, no matter the "scrubFields" param.

I've gone through the scrubber function and simply fixed some parameters & other things to ensure the "scrubFields" param is recognized. I've also updated it to manually recurse the scrubber function (by calling "array_walk" inside the function, only if the value is an array). I believe I did this so that data structures other than arrays get through the scrubber without erroring out.

This wasn't quite working very well before, and was masking values that
shouldn't have been masked. Turning on strict mode fixes this and should
be fairly backward compatible.
@MichaelMackus
Copy link
Contributor Author

Here's a link I found explaining some reasoning behind the previous commit.

@MichaelMackus
Copy link
Contributor Author

@rokob any input? This definitely fixes a lot of issues with the previous scrubber functionality.

@rokob rokob mentioned this pull request Apr 3, 2017
};
array_walk_recursive($arr, $scrubber);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is confusing to me. I don't understand the reasoning behind doing a manual recursion versus array_walk_recursive()

Copy link
Contributor

@ArturMoczulski ArturMoczulski Apr 7, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh, I just saw @MichaelMackus comment above. I think that making the code to error out when passing other types than an array is a good idea since they are not going to get scrubbed. My reasoning is that if I pass some data to be scrubbed (e.g. an object) and the library doesn't support this type, it's a pretty critical issue. We don't want the users to be passing objects and thinking they got scrubbed when they didn't.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Argument I'm making here is that if a data type not supported by the scrubbing method is passed we should at least throw an exception and make it very obvious.

@ArturMoczulski
Copy link
Contributor

Improvements @MichaelMackus did are looking great. I'm going to take his work, use it as a base for my branch and expand on them.

@rokob rokob merged commit 2476983 into rollbar:master Apr 21, 2017
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.

None yet

3 participants