openfoodfacts / openfoodfacts-androidapp

(Legacy) Native version of Open Food Facts on Android - Coders & Decoders welcome 🤳🥫
https://android.openfoodfacts.org
Apache License 2.0
767 stars 447 forks source link

(#1 issue in production) UninitializedPropertyAccessException: lateinit property code has not been initialized @ SummaryProductFragment$showListChips #4222

Closed sentry-io[bot] closed 2 years ago

sentry-io[bot] commented 3 years ago

Note: This issue is currently #1 on Sentry in terms of occurence.

Code pointer: https://github.com/openfoodfacts/openfoodfacts-androidapp/blob/develop/app/src/main/java/openfoodfacts/github/scrachx/openfood/features/product/view/summary/SummaryProductFragment.kt#L516

Sentry Issue: OPENFOODFACTS-ANDROID-4DB

UninitializedPropertyAccessException: lateinit property code has not been initialized
    at openfoodfacts.github.scrachx.openfood.models.SearchProduct.getCode(SearchProduct.kt:20)
    at openfoodfacts.github.scrachx.openfood.features.product.view.summary.SummaryProductFragment$showListChips$1.invokeSuspend(SummaryProductFragment.kt:522)
    at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33)
    at kotlinx.coroutines.internal.DispatchedContinuationKt.resumeCancellableWith(DispatchedContinuation.kt:367)
    at kotlinx.coroutines.intrinsics.CancellableKt.startCoroutineCancellable(Cancellable.kt:30)
...
(84 additional frame(s) were not displayed)
openfoodfacts.github.scrachx.openfood.models.SearchProduct in getCode at line 20
… cts.github.scrachx.openfood.features.product.view.summary.SummaryProductFragment$showListChips$1 in invokeSuspend at line 523
kotlin.coroutines.jvm.internal.BaseContinuationImpl in resumeWith at line 33
kotlinx.coroutines.internal.DispatchedContinuationKt in resumeCancellableWith at line 367
kotlinx.coroutines.intrinsics.CancellableKt in startCoroutineCancellable at line 30
kotlinx.coroutines.intrinsics.CancellableKt in startCoroutineCancellable$default at line 25
kotlinx.coroutines.CoroutineStart in invoke at line 110
kotlinx.coroutines.AbstractCoroutine in start at line 126
kotlinx.coroutines.BuildersKt__Builders_commonKt in launch at line 56
kotlinx.coroutines.BuildersKt in launch at line 1
kotlinx.coroutines.BuildersKt__Builders_commonKt in launch$default at line 47
kotlinx.coroutines.BuildersKt in launch$default at line 1
openfoodfacts.github.scrachx.openfood.features.product.view.summary.SummaryProductFragment in showListChips at line 521
openfoodfacts.github.scrachx.openfood.features.product.view.summary.SummaryProductFragment in refreshView at line 301
openfoodfacts.github.scrachx.openfood.features.product.view.summary.SummaryProductFragment in onViewCreated at line 221
androidx.fragment.app.Fragment in performViewCreated at line 2987
androidx.fragment.app.FragmentStateManager in createView at line 546
androidx.fragment.app.FragmentStateManager in moveToExpectedState at line 282
androidx.fragment.app.FragmentManager in executeOpsTogether at line 2189
androidx.fragment.app.FragmentManager in removeRedundantOperationsAndExecute at line 2100
androidx.fragment.app.FragmentManager in execSingleAction at line 1971
androidx.fragment.app.BackStackRecord in commitNow at line 305
androidx.viewpager2.adapter.FragmentStateAdapter in placeFragmentInViewHolder at line 341
androidx.viewpager2.adapter.FragmentStateAdapter in onViewAttachedToWindow at line 276
androidx.viewpager2.adapter.FragmentStateAdapter in onViewAttachedToWindow at line 67
androidx.recyclerview.widget.RecyclerView in dispatchChildAttached at line 7867
androidx.recyclerview.widget.RecyclerView$5 in addView at line 893
androidx.recyclerview.widget.ChildHelper in addView at line 107
androidx.recyclerview.widget.RecyclerView$LayoutManager in addViewInt at line 8902
androidx.recyclerview.widget.RecyclerView$LayoutManager in addView at line 8860
androidx.recyclerview.widget.RecyclerView$LayoutManager in addView at line 8848
androidx.recyclerview.widget.LinearLayoutManager in layoutChunk at line 1645
androidx.recyclerview.widget.LinearLayoutManager in fill at line 1591
androidx.recyclerview.widget.LinearLayoutManager in onLayoutChildren at line 668
androidx.recyclerview.widget.RecyclerView in dispatchLayoutStep2 at line 4309
androidx.recyclerview.widget.RecyclerView in dispatchLayout at line 4012
androidx.recyclerview.widget.RecyclerView in onLayout at line 4578
android.view.View in layout at line 20672
android.view.ViewGroup in layout at line 6194
androidx.viewpager2.widget.ViewPager2 in onLayout at line 527
android.view.View in layout at line 20672
android.view.ViewGroup in layout at line 6194
com.google.android.material.appbar.HeaderScrollingViewBehavior in layoutChild at line 148
com.google.android.material.appbar.ViewOffsetBehavior in onLayoutChild at line 43
com.google.android.material.appbar.AppBarLayout$ScrollingViewBehavior in onLayoutChild at line 2003
androidx.coordinatorlayout.widget.CoordinatorLayout in onLayout at line 918
android.view.View in layout at line 20672
android.view.ViewGroup in layout at line 6194
androidx.constraintlayout.widget.ConstraintLayout in onLayout at line 1873
android.view.View in layout at line 20672
android.view.ViewGroup in layout at line 6194
android.widget.FrameLayout in layoutChildren at line 323
android.widget.FrameLayout in onLayout at line 261
android.view.View in layout at line 20672
android.view.ViewGroup in layout at line 6194
android.widget.LinearLayout in setChildFrame at line 1812
android.widget.LinearLayout in layoutVertical at line 1656
android.widget.LinearLayout in onLayout at line 1565
android.view.View in layout at line 20672
android.view.ViewGroup in layout at line 6194
android.widget.FrameLayout in layoutChildren at line 323
android.widget.FrameLayout in onLayout at line 261
android.view.View in layout at line 20672
android.view.ViewGroup in layout at line 6194
android.widget.LinearLayout in setChildFrame at line 1812
android.widget.LinearLayout in layoutVertical at line 1656
android.widget.LinearLayout in onLayout at line 1565
android.view.View in layout at line 20672
android.view.ViewGroup in layout at line 6194
android.widget.FrameLayout in layoutChildren at line 323
android.widget.FrameLayout in onLayout at line 261
com.android.internal.policy.DecorView in onLayout at line 753
android.view.View in layout at line 20672
android.view.ViewGroup in layout at line 6194
android.view.ViewRootImpl in performLayout at line 2793
android.view.ViewRootImpl in performTraversals at line 2320
android.view.ViewRootImpl in doTraversal at line 1460
android.view.ViewRootImpl$TraversalRunnable in run at line 7184
android.view.Choreographer$CallbackRecord in run at line 949
android.view.Choreographer in doCallbacks at line 761
android.view.Choreographer in doFrame at line 696
android.view.Choreographer$FrameDisplayEventReceiver in run at line 935
android.os.Handler in handleCallback at line 873
android.os.Handler in dispatchMessage at line 99
android.os.Looper in loop at line 193
android.app.ActivityThread in main at line 6669
java.lang.reflect.Method in invoke
com.android.internal.os.RuntimeInit$MethodAndArgsCaller in run at line 493
com.android.internal.os.ZygoteInit in main at line 858
teolemon commented 2 years ago

@R4md4c could you have a look at this one ? It's currently number one, putting us above the "Bad Behaviour" threshold

image
R4md4c commented 2 years ago

Sure, I'll try to take a look this evening, just to double sure, I didn't cause this regression in one of my submitted PRs, right?

Also any idea about reproduction steps?

teolemon commented 2 years ago

It's been going on for months. Unsure about reproduction steps. It's probably in Read Mode, on the product page, and it probably is related to the List System. cf: https://github.com/openfoodfacts/openfoodfacts-androidapp/blob/cc54f8a012fc1961dd1e6b0955401a74da7b2f11/app/src/main/java/openfoodfacts/github/scrachx/openfood/features/product/view/summary/SummaryProductFragment.kt#L526