-
Notifications
You must be signed in to change notification settings - Fork 76
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
Enforce CADisableMinimumFrameDurationOnPhone
#1451
Conversation
compose/ui/ui/src/uikitMain/kotlin/androidx/compose/ui/uikit/PlistSanityCheck.uikit.kt
Outdated
Show resolved
Hide resolved
Please, change it to |
CADisableMinimumFrameDurationOnPhone
...src/uikitMain/kotlin/androidx/compose/ui/uikit/ComposeUIViewControllerConfiguration.uikit.kt
Outdated
Show resolved
Hide resolved
compose/ui/ui/src/uikitMain/kotlin/androidx/compose/ui/uikit/PlistSanityCheck.uikit.kt
Outdated
Show resolved
Hide resolved
compose/ui/ui/src/uikitMain/kotlin/androidx/compose/ui/uikit/PlistSanityCheck.uikit.kt
Outdated
Show resolved
Hide resolved
configuration = ComposeUIViewControllerConfiguration().apply { | ||
// TODO: setup proper plist for instrumented test | ||
// https://youtrack.jetbrains.com/issue/CMP-5706/iOS-setup-proper-plist-in-instrumented-tests | ||
enforceStrictPlistSanityCheck = false |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Will it mean that user UI tests also fail? Could you check?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, it's a breaking change.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What I wonder, if it fail in these cases:
- when user uses our
ui-test
API. Does it useComposeUIViewController
inside? - when user just uses
ComposeUIViewController
in the test. Does it uses the same plist as for the main application?
If we don't force users to specify enforceStrictPlistSanityCheck = false
in their tests - it is good. If we force - it isn't, and we should weight all pros/cons.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh... I've just realised, that our test api on iOS is internal
, so no blocker here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
UIKitInstrumentedTest
is internal, yes, no blocker with it. But what is with the others?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We don't have other usages. If you mean other people rolling their own testing and getting a crash if plist is wrong - then it's by design. They can specifically opt out of this behavior if they don't need it for test. That's the whole rationale behind this PR.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's completely normal that manifest inconsistencies cause a crash in runtime on iOS - a good example of it is lack of privacy description in plist, whenever a user attempts to access privacy-protected API.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It looks like for now instrumented tests aren't use plist file, and considering the fact we're not running tests on a real device, I would recommend to keep as it is and remove TODO part.
compose/ui/ui/src/uikitInstrumentedTest/kotlin/android/compose/ui/test/UIKitInstrumentedTest.kt
Show resolved
Hide resolved
Relaxed the check a change to crash only on iPhone. Apparently, iPad is not affected by this flag. |
Better to reenable it:
|
compose/ui/ui/src/uikitMain/kotlin/androidx/compose/ui/uikit/PlistSanityCheck.uikit.kt
Outdated
Show resolved
Hide resolved
7b25bc8
to
1d9279e
Compare
Oh oh... still not merged |
…listSanityCheck.uikit.kt Co-authored-by: Igor Demin <igordmn@users.noreply.github.com>
…listSanityCheck.uikit.kt Co-authored-by: Igor Demin <igordmn@users.noreply.github.com>
…omposeUIViewControllerConfiguration.uikit.kt Co-authored-by: Igor Demin <igordmn@users.noreply.github.com>
…listSanityCheck.uikit.kt Co-authored-by: Igor Demin <igordmn@users.noreply.github.com>
9c2b1ff
to
8644cab
Compare
Removed TODO |
Proposed Changes
By default, crash applications which don't contain a proper
CADisableMinimumFrameDurationOnPhone
entry in the Info.plist, when running on an iPhone.Implementation for https://youtrack.jetbrains.com/issue/CMP-5643/Make-CADisableMinimumFrameDurationOnPhone-a-requirement-to-run-Compose-Multiplatform-on-iOS
Release Notes
iOS - Breaking Changes
CADisableMinimumFrameDurationOnPhone
is not set to true inInfo.plist
. Use newly addedComposeUIViewControllerConfiguration.enforceStrictPlistSanityCheck
to opt-out of this behavior.