-
Notifications
You must be signed in to change notification settings - Fork 48
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
Only obfuscate if the instance has the field in question. #28
Conversation
Hello, @craigmcnamara. Have you run into a bug because of this? |
The code there is playing fast and loose with I had a fairly involved explore chain, and with the exception of this bug Polo works great. |
It seems that the bug is only on the |
fe1c8a4
to
08b94ed
Compare
@@ -88,6 +88,20 @@ | |||
|
|||
expect(inserts).to eq [ %q{INSERT INTO "chefs" ("id", "name", "email") VALUES (1, 'Netto', 'changeme')} ] | |||
end | |||
|
|||
it 'only scrables instances with the obfuscate field defined' do |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
maybe you mean scramble here?
I think I'm starting to understand this problem a little better now. We always check that the fields actually exist before we try to obfuscate it. As you can see, we never actually try to apply a transformation on fields that don't exist. We would apply the transformation if the field is With this mind we have two options: a) Check if the field we're trying to obfuscate is I tend to like I don't want to prolong the discussion for too long though, so I'm ok with adding the Thank you! |
A little more detail, here https://github.com/IFTTT/polo/blob/master/lib/polo/translator.rb#L38 the intersection of fields to scrub is only checked if there are any fields to scrub. The inner loop operates on the full original set of fields passed in. I tried rewriting it to get the fields from the intersection method, but more things in unrelated specs failed. If you change the field check back to the original and run the new spec it fails with
|
08b94ed
to
df84c15
Compare
oh, yeah. That makes total sense. I'll go ahead and merge this in. Thanks for catching this. |
@craigmcnamara: Would you mind taking some time and responding to this? |
Only obfuscate if the instance has the field in question.
I'd be happy to, thanks for merging the pull. |
No description provided.