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

Fallback to empty list when block type is not present #22846

Merged
merged 4 commits into from
Nov 13, 2024

Conversation

KevinMind
Copy link
Contributor

This reverts commit 2bd0783.

Fixes: mozilla/addons#15163

Context

After #22715 we introduced soft_blocked key to the cache.json, however the first time we ran the filter it compared to a cache.json that did not have soft_blocked and this led to failures when generating diffs.

This should really never happen after the first iteration but it's good to have this fallback in place if for any reason we have a broken cache.json

Testing

  1. create a bloom filter
  2. manually delete one of the keys from cache.json
  3. create another bloom filter
  4. generate a diff from the first filter and expect an empty array for the key that is missing

Checklist

  • Add #ISSUENUM at the top of your PR to an existing open issue in the mozilla/addons repository.
  • Successfully verified the change locally.
  • The change is covered by automated tests, or otherwise indicated why doing so is unnecessary/impossible.
  • Add before and after screenshots (Only for changes that impact the UI).
  • Add or update relevant docs reflecting the changes made.

@KevinMind KevinMind changed the title Fix-missing-cache Fallback to empty list when block type is not present Nov 13, 2024
Copy link
Member

@willdurand willdurand left a comment

Choose a reason for hiding this comment

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

Add the regression test and we should be good to go.

src/olympia/blocklist/tests/test_mlbf.py Show resolved Hide resolved
src/olympia/blocklist/tests/test_mlbf.py Show resolved Hide resolved
Copy link
Member

@willdurand willdurand left a comment

Choose a reason for hiding this comment

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

r+wc

src/olympia/blocklist/tests/test_mlbf.py Show resolved Hide resolved
src/olympia/blocklist/tests/test_mlbf.py Show resolved Hide resolved
@KevinMind KevinMind merged commit 9ac9c76 into master Nov 13, 2024
33 checks passed
@KevinMind KevinMind deleted the fix-missing-cache branch November 13, 2024 14:33
KevinMind added a commit that referenced this pull request Nov 13, 2024
* Revert "Revert "Fallback to empty list when block type is not present on cache.json""

This reverts commit 2bd0783.

* Add regression test + comment

* Format

* Validate diff adds and omits from corupted cache.
@KevinMind KevinMind modified the milestones: 2024.11.28, 2024.11.14 Nov 13, 2024
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.

[Bug]: Missing block type in cache.json results in non interable data set
2 participants