woocommerce / woocommerce-android

WooCommerce Android app
https://www.woocommerce.com/mobile
GNU General Public License v2.0
277 stars 135 forks source link

[Crash] Fix crash when edit of an order clicked #12893

Closed kidinov closed 6 days ago

kidinov commented 1 week ago

Description

The PR caused a breakage of edit functionality of an order:

Process: com.woocommerce.android.dev, PID: 15852
java.lang.IllegalStateException: Multiple observers registered but only one is supported.
at com.woocommerce.android.viewmodel.LiveDataDelegate.observe(LiveDataDelegate.kt:53)
at com.woocommerce.android.ui.orders.creation.OrderCreateEditFormFragment.observeViewStateChanges(OrderCreateEditFormFragment.kt:486)
at com.woocommerce.android.ui.orders.creation.OrderCreateEditFormFragment.setupObserversWith(OrderCreateEditFormFragment.kt:417)
at com.woocommerce.android.ui.orders.creation.OrderCreateEditFormFragment.onViewCreated(OrderCreateEditFormFragment.kt:164)
at androidx.fragment.app.Fragment.performViewCreated(Fragment.java:3152)
at androidx.fragment.app.FragmentStateManager.createView(FragmentStateManager.java:608)
at androidx.fragment.app.FragmentStateManager.moveToExpectedState(FragmentStateManager.java:286)
at androidx.fragment.app.FragmentManager.executeOpsTogether(FragmentManager.java:2164)
at androidx.fragment.app.FragmentManager.removeRedundantOperationsAndExecute(FragmentManager.java:2065)
at androidx.fragment.app.FragmentManager.execPendingActions(FragmentManager.java:2002)
at androidx.fragment.app.FragmentManager$5.run(FragmentManager.java:702)
at android.os.Handler.handleCallback(Handler.java:938)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loopOnce(Looper.java:201)
at android.os.Looper.loop(Looper.java:288)
at android.app.ActivityThread.main(ActivityThread.java:7839)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:548)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1003)

This fixes the crash

Steps to reproduce

Orders -> Order -> Edit -> notice crash

Testing information

Reviewer (or Author, in the case of optional code reviews):

Please make sure these conditions are met before approving the PR, or request changes if the PR needs improvement:

wpmobilebot commented 1 week ago
📲 You can test the changes from this Pull Request in WooCommerce-Wear Android by scanning the QR code below to install the corresponding build.
App Name WooCommerce-Wear Android
Platform⌚️ Wear OS
FlavorJalapeno
Build TypeDebug
Commit3c32e06ea8d720c1fb93991df88e31793ba0d6ce
Direct Downloadwoocommerce-wear-prototype-build-pr12893-3c32e06.apk
wpmobilebot commented 1 week ago

📲 You can test the changes from this Pull Request in WooCommerce Android by scanning the QR code below to install the corresponding build.

App Name WooCommerce Android
Platform📱 Mobile
FlavorJalapeno
Build TypeDebug
Commit3c32e06ea8d720c1fb93991df88e31793ba0d6ce
Direct Downloadwoocommerce-prototype-build-pr12893-3c32e06.apk
wpmobilebot commented 1 week ago

Version 21.1 has now entered code-freeze, so the milestone of this PR has been updated to 21.2.

kidinov commented 6 days ago

That was fixed in another PR