Newpipe: Crash at the end of the video list with PeerTube/Local playlist

Created on 10 Oct 2020  路  12Comments  路  Source: TeamNewPipe/NewPipe

Checklist

Steps to reproduce the bug

  1. Set up peertube.debian.social as the peertube instance
  2. Open Trending/Local/whatever
  3. Attempt to scroll beyond the last element

Actual behaviour

Crash (see below).

Expected behavior

I鈥檇 expect more video thumbnails to appear.

Logs

Exception

  • __User Action:__ ui error
  • __Request:__ App crash, UI failure
  • __Content Country:__ GB
  • __Content Language:__ en-GB
  • __App Language:__ en_GB
  • __Service:__ none
  • __Version:__ 0.20.0
  • __OS:__ Linux Android 9 - 28
    Crash log

java.lang.IllegalStateException: ViewHolder views must not be attached when created. Ensure that you are not passing 'true' to the attachToRoot parameter of LayoutInflater.inflate(..., boolean attachToRoot)
    at androidx.recyclerview.widget.RecyclerView$Adapter.createViewHolder(RecyclerView.java:7080)
    at androidx.recyclerview.widget.RecyclerView$Recycler.tryGetViewHolderForPositionByDeadline(RecyclerView.java:6235)
    at androidx.recyclerview.widget.GapWorker.prefetchPositionWithDeadline(GapWorker.java:288)
    at androidx.recyclerview.widget.GapWorker.flushTaskWithDeadline(GapWorker.java:345)
    at androidx.recyclerview.widget.GapWorker.flushTasksWithDeadline(GapWorker.java:361)
    at androidx.recyclerview.widget.GapWorker.prefetch(GapWorker.java:368)
    at androidx.recyclerview.widget.GapWorker.run(GapWorker.java:399)
    at android.os.Handler.handleCallback(Handler.java:873)
    at android.os.Handler.dispatchMessage(Handler.java:99)
    at android.os.Looper.loop(Looper.java:193)
    at android.app.ActivityThread.main(ActivityThread.java:6680)
    at java.lang.reflect.Method.invoke(Native Method)
    at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:493)
    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:858)



Device info

  • Device model: Mi Box S
GUI bug

All 12 comments

This was already reported a while ago, and there is unfortunately no way to reproduce. It has nothing to do with PeerTube in particular, but just with lists. If there will be a way to reproduce this consistently this issue can be reopened, but as of now there is none. Thank you for the report anyway! ;-)

Well, it happens here all the time, each time, is there any way I can use this to help?

Ah. Then we probably need logs, don't we, @Stypox?

I don't think logs would help. I already tried fixing this bug but failed, since NewPipe is already doing what the error suggests to do:

Ensure that you are not passing 'true' to the attachToRoot parameter of LayoutInflater.inflate(..., boolean attachToRoot)

So it's an OS bug that NewPipe can't work around. Okay. Sorry, @andrewshadura.

Can鈥檛 we at least catch the exception in a better way?

The issue is, that exception does not come from NewPipe's code, but from some other library code. Therefore catching the error and ignoring it would probably not solve anything, because the app would be put in an unstable state where something is wrong and would crash again with another kind of crash.

I鈥檝e just found an interesting fact. First of all, I鈥檓 using a remove to navigate the list. Second, it only happens when I navigate it in a particular way. The screen is a grid of 2陆 rows by 5 columns. For some reason, only 12 thumbnails are displayed:
2020-10-11 15 18 36
The crash usually happens when I press "down" while the last element is focused (but not every time, I haven鈥檛 found the exact 100% reproducible sequence).
2020-10-11 15 19 32

I鈥檓 wondering, can the crash be somehow related with the fact fewer items have been preloaded than the grid expects? I don鈥檛 understand it from the code, how is the number of items to preload determined?

Thank you for the further information. This might be related to the issue about infinite loading in lists when the initial number of items is smaller than the screen size (I read about that issue earlier today, but now can't find it anymore. @opusforlife2 can you find it?)

how is the number of items to preload determined?

That's service-dependent, i.e. it depends on the implementation of the service in NewPipeExtractor.

@Stypox #1974.

Looks like I have the same issue scrolling down manualy created Bookmarked Playlist.

I was able to reproduce this twice. Steps:

  1. Open a Bookmarked Playlist with a lot of videos i.e. scrollable
  2. Tap one of the latest videos and watch it till the end (possibly in fullscreen mode). You cat FF of course.
  3. Press back to return to the playlist.
  4. Scroll to the top of the playlist.
Was this page helpful?
0 / 5 - 0 ratings

Related issues

hassanseoul123 picture hassanseoul123  路  3Comments

cavemandaveman picture cavemandaveman  路  3Comments

ghost picture ghost  路  3Comments

Wang-GY picture Wang-GY  路  3Comments

cool-student picture cool-student  路  3Comments