JetBrains / compose-multiplatform

Compose Multiplatform, a modern UI framework for Kotlin that makes building performant and beautiful user interfaces easy and enjoyable.
https://jetbrains.com/lp/compose-multiplatform
Apache License 2.0
15.9k stars 1.16k forks source link

iOS version 17.2 fails to fully recompose #4063

Open jamesbmorris4444 opened 8 months ago

jamesbmorris4444 commented 8 months ago

Describe the bug A button is clicked on a screen that causes a recompose. Most of the screen is recomposed properly, but in iOS 17.2 the recompose fails to show a list at the bottom of the screen. This issue does not occur in the SAME CODE for Android, nor does the issue occur in iOS version 17.0.

Affected platforms

Versions

To Reproduce Occurs only in my local code

Expected behavior In the first screenshot there is a CONFIRM button and no list at the bottom of the screen. The next screenshot show the list displayed after clicking the CONFIRM button. These screenshot were created on iOS 17.0. On iOS 17.2, the list does not appear. In the compose code for iOS 17.2, the recompose starts properly, but simply fails to execute the composable method that displays the list.

Update: I upgraded KMP plugin in Android Studio to 1.5.11, kotlin to 1.9.21, and org.jetbrains.compose to 1.6.0-alpha01. After this, the issue now occurs in even iOS 17.0.

Screenshots Simulator Screenshot - iPhone 15 Pro Max - 2023-12-23 at 11 14 33 Simulator Screenshot - iPhone 15 Pro Max - 2023-12-23 at 11 14 45

dima-avdeev-jb commented 8 months ago

Thanks for Issue. Can you please create a minimal reproducible sample project on GitHub?

jamesbmorris4444 commented 8 months ago

You can clone https://github.com/jamesbmorris4444/KmpMACETemplate/tree/bug-branch to AS. This is a public repo.

To see correct behavior:

  1. Build on Android emulator.
  2. In the first screen, type "mor" or "mil" into the EditText at the top of the screen.
  3. Click "Search"
  4. In the list of two names that appears, click either entry.
  5. Click "Update"
  6. Click "OK"
  7. On the next screen enter any text into the three EditText fields in the 2x2 grid
  8. Click "Confirm" You should see a new entry appear below the grid. That is correct behavior.

To see the issue:

  1. Build on an iOS emulator running version 17.2 (17.0 should work ok) The rest is the same, but the new entry does not appear below the grid after step 8.

From Logger.i logs, you should see (on Android) JIMX Recompose 1 JIMX Recompose 2 JIMX Recompose 3 JIMX Recompose 4 JIMX Recompose 5 JIMX Recompose 6 appear when you click "Confirm"

On iOS 17.2, you should see JIMX Recompose 1 JIMX Recompose 2 JIMX Recompose 3 JIMX Recompose 6

The logs for JIMX Recompose 4 JIMX Recompose 5 do not appear

The files of interest are CreateProductsScreen.kt and SharedMethods.kt. They have the Logger.i calls.

One other thing. When I was creating this email, I got failures on iOS 17.0 also, although I could also get 17.0 to behave correctly by switching to a different iOS 17.0 emulator. But 17.2 never worked for me.

On Tue, Dec 26, 2023 at 6:21 PM dima.avdeev @.***> wrote:

Thanks for Issue. Can you please create a minimal reproducible sample project on GitHub?

— Reply to this email directly, view it on GitHub https://github.com/JetBrains/compose-multiplatform/issues/4063#issuecomment-1869577712, or unsubscribe https://github.com/notifications/unsubscribe-auth/AIPN5TLJULRAUEAFZDA3FBLYLLMNJAVCNFSM6AAAAABBATYD52VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTQNRZGU3TONZRGI . You are receiving this because you authored the thread.Message ID: @.***>

okushnikov commented 2 weeks ago

Please check the following ticket on YouTrack for follow-ups to this issue. GitHub issues will be closed in the coming weeks.