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

Skip Invalid Rule Instead of Skipping All Remaining Candidate Rules #6

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

craighowarth
Copy link

If you have a rule that has a predicate that is invalid, the Brain was skipping all remaining valid rules and reporting that no rule was found.

10: field == 'oneline' => fieldStyle = onelineBase
20: field == 'oneline' AND screen == 'small' => fieldStyle = headlineOtherNewsRed
30: field == 'oneline' AND screen == 'small' AND foo == 'bar' => fieldStyle = headlineOtherNewsBlue

The above code was causing the rule engine to report that no match was found for small screens because the foo predicate was unknown to the engine. Instead of just ignoring that rule and falling back to the 2nd rule, it was saying no match was found.

This fix will fallback to another candidate if it exists.

Note that Cocoapods 1.84 changed some project files when I ran pod install to set up the project. I can remove those changes if you'd like.

@craighowarth
Copy link
Author

Hi, Jim! Hope you are well!

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.

2 participants