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

Scrub all occurrences of objects seen twice #913

Merged
merged 2 commits into from Jan 25, 2021

Conversation

waltjones
Copy link
Contributor

@waltjones waltjones commented Dec 22, 2020

Description of the change

The traversal logic used for scrubbing payloads has circular traversal protection to prevent infinite traversal of objects that contain circular references. The scrubbing logic always modifies a copy of objects that are scrubbed, and doesn't mutate the original object.

When scrubbing, the bug existed where when the original object was detected two or more times (circular traversal protection), the original object was used in the final payload, not the modified copy. If scrub fields existed in these objects, the unscrubbed version would be added to the payload.

This PR updates the traversal logic to use the previously scrubbed copy of the data in these cases.

Type of change

  • Bug fix (non-breaking change that fixes an issue)
  • New feature (non-breaking change that adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)

Related issues

Fixes: #912

Development

  • Lint rules pass locally
  • The code changed/added as part of this pull request has been covered with tests
  • All tests related to the changed code pass in development

Code review

  • This pull request has a descriptive title and information useful to a reviewer. There may be a screenshot or screencast attached
  • "Ready for review" label attached to the PR and reviewers mentioned in a comment
  • Changes have been reviewed by at least one other engineer
  • Issue from task tracker has a link to this pull request

@waltjones waltjones changed the title WIP: test scrubbing of objects seen twice Test scrubbing of objects seen twice Jan 20, 2021
@waltjones waltjones changed the title Test scrubbing of objects seen twice Scrub all occurrences of objects seen twice Jan 20, 2021
Copy link
Contributor

@mrunalk mrunalk left a comment

Choose a reason for hiding this comment

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

LGTM.

@waltjones waltjones merged commit a1fd7a1 into master Jan 25, 2021
mudetroit pushed a commit that referenced this pull request Mar 14, 2024
* test: test scrubbing of objects seen twice

* fix: scrub objects seen twice
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Scrubbing not working when object referenced multiple times in item metadata
2 participants