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

fix(iOS): fix iOS 15.5 NSPredicate error. #3420

Merged
merged 2 commits into from May 25, 2022

Conversation

asafkorem
Copy link
Contributor

@asafkorem asafkorem commented May 25, 2022

Fix crash due to a new NSPredicate error.

This new error caused by accessing a computed property by its keypath inside a predicate (NSExpression comparison). This raised a mysterious new Signal 6 (for simulators with iOS version 15.5) from [_NSPredicateUtilities _predicateSecurityAction].

The exception error message was: NSPredicate: NSFunctionExpression with selector 'dtx_text' is forbidden. (dtx_text is a computed property).

Replacing the expression comparison predicate with a block predicate and calling the computed property dtx_text as calling a method on the evaluated object solved this issue.

Fix crashes due to a new `NSPredicate` error.

The specific error caused by accessing a computed property by its keypath inside a
 predicate (`NSExpression` comparison). This raised a mysterious new Signal 6
 from `[_NSPredicateUtilities _predicateSecurityAction]`.

The crash log in the simulator was:
 `NSPredicate: NSFunctionExpression with selector 'dtx_text' is forbidden.`.

Replacing the expression comparison predicate with a block predicate and calling the computed
 property `dtx_text` as calling a method solved this issue.
Auto re-indent by Xcode.
@asafkorem asafkorem changed the title fix(iOS): fix iOS > 15.0 crashes. fix(iOS): fix iOS > 15.0 NSPredicate error. May 25, 2022
@asafkorem asafkorem merged commit a28d743 into wix:master May 25, 2022
@asafkorem asafkorem deleted the fix/nspredicate-crash-ios branch May 25, 2022 12:06
@asafkorem
Copy link
Contributor Author

This fix is now part of Detox v19.7.0, see: https://github.com/wix/Detox/releases/tag/19.7.0.

@asafkorem asafkorem changed the title fix(iOS): fix iOS > 15.0 NSPredicate error. fix(iOS): fix iOS 15.5 NSPredicate error. May 25, 2022
@asafkorem asafkorem changed the title fix(iOS): fix iOS 15.5 NSPredicate error. fix(iOS): fix iOS > 15.0 NSPredicate error. May 25, 2022
@asafkorem asafkorem changed the title fix(iOS): fix iOS > 15.0 NSPredicate error. fix(iOS): fix iOS 15.5 NSPredicate error. May 25, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
1 participant