@yaelirub This seems like a likely candidate to prioritize.
Sentry Url: https://sentry.io/share/issue/5dbe759077c94810977d8e2caf43a625/
User Count: 614
Count: 1342
First Release: org.wordpress.android-14.6
First Seen: 2019-07-05T19:32:43Z
Last Seen: 2020-07-16T13:38:40Z
24 Hours: 13
30 Days: 444
IndexOutOfBoundsException: Inconsistency detected. Invalid view holder adapter positionLinkViewHolder{289926d position=9 id=-1, oldPos=8, pLpos:8 scrap [attachedScrap] tmpDetached no parent} androidx.recyclerview.widget.RecyclerView{9331caf VFED..... ......I. 4,4-1380,1646 #7f09072a app:id/stats_block_list}, adapter:org.wordpress.android.ui.stats.refresh.lists.sections.BlockListAdapter@bdab8bc, layout:org.wordpress.android.ui.stats.refresh.utils.WrappingLinearLayoutManager@dd22045, context:org.wordpress.android.ui.stats.refresh.StatsActivity@d59d543
...
(76 additional frame(s) were not displayed)
| Fails | |
|---|---|
| :no_entry_sign: | Please add a feature label to this issue. e.g. 'Stats' |
Generated by :no_entry_sign: dangerJS
Thanks @oguzkocer , gave it Priority medium and will ask @zwarm to take a look in case it needs to be higher priority or can be solved in a timely manner
@oguzkocer @yaelirub
I took a quick look through this crash, but unfortunately I have been unable to recreate this crash. I attempted on physical device (Samsung S20) and emulators running API 21 & 29. I have added numerous delays of varying milliseconds (1000 to 30000) and the effect was the same, no crash.
Based on the sentry, this crash first appearred in July 2019 and across a wide range of devices. Going through the stack trace, the flow looks like this: StatsActivity or StatsDetailActivity => BlockListAdapter => WrappingLinearLayoutManager =>
ListItemWithIconViewHolder
I've done some Googling, but nothing specific jumps out to me. This older stackoverflow) article contains possible work arounds, but without locating the exact location of the crash it was difficult to attempt any to see if they are the cause of our crash. (I don't agree the try/catch approach as a solution).
The stats code already uses a DiffUtil and dispatches changes as soon as they happen, so I don't think this is the cause. The stats code also uses a custom WrappingLinearLayoutManager to manage the height of the RV while animating on removal. Could be possible that the RV has somehow gotten out of whack and data is changing as animation is happening.
I also found this older Google issue that has a very lengthy thread, but could be helpful to someone with more of a background in the stats feature. I would love to pair with whomever picks this up next, so I can learn a bit how the stats feature functions.
This issue seems to have been reported before in #11589 which I missed when I created the issue. Due to the importance of the collective two issues, I decided to give it a shot myself and opened a PR which hopefully fixes them. The details can be found in #12475.
Most helpful comment
This issue seems to have been reported before in #11589 which I missed when I created the issue. Due to the importance of the collective two issues, I decided to give it a shot myself and opened a PR which hopefully fixes them. The details can be found in #12475.