CV2-4223 readd condition for checking if we should even search for the type #1780
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
In
Bot::Alegre.get_similar_items(pm)
(i.e. the original similarity matching function in alegre), we run a conditional check of!Bot::Alegre.should_get_similar_items_of_type?('master', pm.team_id) || !Bot::Alegre.should_get_similar_items_of_type?(type, pm.team_id)
- this effectively checks the team to ensure that similarity searching is enabled at all, and specifically, similarity searching for that media modality is enabled. In the massive simplification/refactor, we lost that condition for V2. Adding that back in at the point of search, which should be all that's needed to get Alegre back to spec.References: CV2-4223
How has this been tested?
Strange that we didn't have a unit test for this - I will be writing one for this test case, but I want to see test results for just the change itself with no alterations to tests first to see if there's breaks in existing tests - will serve as the jumping off point for rewriting those tests or adding new ones.
Things to pay attention to during code review
Are we missing any other "core" features? This would be a good time to check!
Checklist