jellyfin / jellyfin-roku

The Official Roku Client for Jellyfin
https://jellyfin.org
GNU General Public License v2.0
450 stars 141 forks source link

v1.6 Build 2 crashes when scrolling episode list on Shows with more than 27 episodes #910

Closed TommyNorthAL closed 1 year ago

TommyNorthAL commented 1 year ago

Software Versions Jellyfin Server Version: 10.8.8 Roku Client Version: 1.6 Build 2

Describe the bug When scrolling thru the episode list on a show with more than 27 episodes, it crashes and returns to the Roku homepage. Observed first crash is after scrolling from episode 27 to episode 28. My testing was to then restart the Roku and it repeated any number of times. After a restart, I did not experience the issue with a show that has fewer episodes, shows with 21 did not crash when scrolling all the way thru the list. Without restarting I had trouble with shows with many fewer episodes. The specific show I had trouble with is Perry Mason, an old B&W standard def show, each one about 50 minutes.

How To Reproduce Steps to reproduce the behavior:

  1. Select a show and season with more than 27 episodes
  2. Open the season, showing the episode list
  3. Scroll down repeatedly, for me past episode 27
  4. Bug occurs

Expected behavior I have not experienced the crash on prior releases, but I cannot say I ever specifically tested it.

Logs None found (server logs, I don't know how to do Roku log

Screenshots N/A.

Connection Information server and Roku are on same WiFi

Is server connection http or https? it's just a port on local server

Additional context This is a real problem, I hope you can fix quickly

jimdogx commented 1 year ago

If you're able to get the logs from the Roku when it crashes that would be great:

https://github.com/jellyfin/jellyfin-roku/blob/unstable/DEVGUIDE.md#bugcrash-reports

If not, it sounds like it's easy enough to reproduce. Thanks 👍

TommyNorthAL commented 1 year ago

I am not Roku developer, but I looked at how to get in developer mode and I can do that, I think, but if you can reproduce that would be much better to me. My development work is all high level stuff.

From: Jimi @.> Sent: Monday, December 19, 2022 09:11 To: jellyfin/jellyfin-roku @.> Cc: Tommy Thomas @.>; Author @.> Subject: Re: [jellyfin/jellyfin-roku] v1.6 Build 2 crashes when scrolling episode list on Shows with more than 27 episodes (Issue #910)

If you're able to get the logs from the Roku when it crashes that would be great:

https://github.com/jellyfin/jellyfin-roku/blob/unstable/DEVGUIDE.md#bugcrash-reportshttps://na01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fjellyfin%2Fjellyfin-roku%2Fblob%2Funstable%2FDEVGUIDE.md%23bugcrash-reports&data=05%7C01%7C%7C80206812554547d487c608dae1d32cc6%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C638070594346930885%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=vU2uepDYShOXecyp3AAq%2FB0TPMXUYTJVFpgG0A7Tp0k%3D&reserved=0

If not, it sounds like it's easy enough to reproduce. Thanks 👍

— Reply to this email directly, view it on GitHubhttps://na01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fjellyfin%2Fjellyfin-roku%2Fissues%2F910%23issuecomment-1357812925&data=05%7C01%7C%7C80206812554547d487c608dae1d32cc6%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C638070594346930885%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=YKXJazD6vEQqJxGR5nNGaufenRYpVi3x%2FY2swTfqV2w%3D&reserved=0, or unsubscribehttps://na01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fnotifications%2Funsubscribe-auth%2FACXVE3ADIJ5FKTMHDANYMI3WOB3GRANCNFSM6AAAAAATDON6XA&data=05%7C01%7C%7C80206812554547d487c608dae1d32cc6%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C638070594346930885%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=r%2FqzytcLtuHWASVvG6TvRzuvJUZXZ5a6btMG9KblCeM%3D&reserved=0. You are receiving this because you authored the thread.Message ID: @.**@.>>

ApexArray commented 1 year ago

I also saw this issue, but it was only when hovering over an episode without a community rating (no star or rating number). Is that also the case for you?

In my situation, the debugger pointed to TVListDetails.brs#L53. The star and communityRating nodes do not exist for these episodes, so it throws an error Invalid value for left-side of expression.

I'm a little confused because the if statement should prevent items without a community rating from hitting line 53, right? But for some reason, there appears to be a mismatch between itemData and the current UI node. Perhaps due to some sort of race condition.

I fixed it by replacing TVListDetails.brs#L57 with the following.

m.top.findnode("rating").visible = false

However, it's probably best to fix the root cause and ensure itemData always matches the currently selected UI node.

TommyNorthAL commented 1 year ago

In my case, almost none of the episodes have ratings, and not any near where it crashes.

Tommy


From: ApexArray @.> Sent: Monday, December 19, 2022 1:45:24 PM To: jellyfin/jellyfin-roku @.> Cc: Tommy Thomas @.>; Author @.> Subject: Re: [jellyfin/jellyfin-roku] v1.6 Build 2 crashes when scrolling episode list on Shows with more than 27 episodes (Issue #910)

I also saw this issue, but it was only when hovering over an episode without a community rating (no star or rating number).

Is that also the case for you? If so, I believe I have a fix.

— Reply to this email directly, view it on GitHubhttps://na01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fjellyfin%2Fjellyfin-roku%2Fissues%2F910%23issuecomment-1358169842&data=05%7C01%7C%7C52fb2b1b751649edbcf708dae1f99296%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C638070759273972621%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=UbIoxPgG76gYXcQeJyylltQvKjVoE3Tf8ywVRoDUn8E%3D&reserved=0, or unsubscribehttps://na01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fnotifications%2Funsubscribe-auth%2FACXVE3GLPRUM7HMQFIBSOU3WOC3NJANCNFSM6AAAAAATDON6XA&data=05%7C01%7C%7C52fb2b1b751649edbcf708dae1f99296%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C638070759273972621%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=gzbTiH8YVOiwZIMuR9yxYvQqhzdouW91lYbEOs%2B0pRU%3D&reserved=0. You are receiving this because you authored the thread.Message ID: @.***>

ApexArray commented 1 year ago

Interesting. I loaded a TV show season with 33 episodes (and no community ratings) and was able to browse through each one without any issues. So I guess thee issue I was seeing only occurs when moving from a TV show with a rating to one without it. I

I wonder if the underlying issue is also affecting other properties. Can you spot any differences in the episode that causes the crash (e.g., air date, audio/video encoding track)?

TommyNorthAL commented 1 year ago

I'm at a loss, but here is what I can report, have tried to be methodical:

  1. The only show I have trouble with is Perry Mason, each season has 30 episodes, very few have viewer ratings.
  2. I tried any number of other shows, with episodes of 20-22, and no problems.
  3. The show in various seasons of Perry Mason crash on the same episode for that season each time, but for instance in season 1 it is episode 28 if scrolling down, episode 18 if scrolling up (from last to beginning). This absolutely repeats after restarting app or restarting roku, it's always those episodes for that season. But for season 2, also 30 episodes, it is episode 2 if scrolling down, 24 if scrolling up, repeatably.
  4. In terms of watched/unwatched, season 1 has 8 episodes unwatched, all 30 in season 2 are unwatched.
  5. I delete the app from the roku and reinstalled it, no change, not even in which episode crashed it.
  6. To emphasize, this is not trying to watch an episode, but merely trying to scroll to it or past it in the episode listing of the show season.
  7. Each of these shows plays fine on my server (PC). In fact, episode 18 in season 1 that crashes when scrolling last to beginning direction is an episode I watched previously, but before latest version of Roku/JF.
  8. Jellyfin/server version 10.8.8, roku 11.5.0 build 4312, jellyfin/roku 1.6 build 2
  9. Server log doesn't show anything that looks like errors
  10. From: ApexArray @.> Sent: Monday, December 19, 2022 15:49 To: jellyfin/jellyfin-roku @.> Cc: Tommy Thomas @.>; Author @.> Subject: Re: [jellyfin/jellyfin-roku] v1.6 Build 2 crashes when scrolling episode list on Shows with more than 27 episodes (Issue #910)

Interesting. I loaded a TV show season with 33 episodes (and no community ratings) and was able to browse through each one without any issues. So I guess thee issue I was seeing only occurs when moving from a TV show with a rating to one without it. I

I wonder if the underlying issue is also affecting other properties. Can you spot any differences in the episode that causes the crash (e.g., air date, audio/video encoding track)?

- Reply to this email directly, view it on GitHubhttps://na01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fjellyfin%2Fjellyfin-roku%2Fissues%2F910%23issuecomment-1358433646&data=05%7C01%7C%7Cd9a332b27ed640f3e9ca08dae20ad548%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C638070833401027112%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=IWacKmbFdHFogoYeJudy7nEAcpW41uVZKZ1CQ3X%2B2is%3D&reserved=0, or unsubscribehttps://na01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fnotifications%2Funsubscribe-auth%2FACXVE3AIOD3CZQBQKCQ7WGTWODJ4RANCNFSM6AAAAAATDON6XA&data=05%7C01%7C%7Cd9a332b27ed640f3e9ca08dae20ad548%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C638070833401027112%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=pUtQcBK%2ByaqmK19ibgOS8c5A7KX%2FvwGoD1EX1dV93ck%3D&reserved=0. You are receiving this because you authored the thread.Message ID: @.***>

ApexArray commented 1 year ago

Okay, I think I have it narrowed down. In my scenario:

I think the solution is to grab references to those nodes during init() like this image

And then update the referenced variables during itemContentChanged() like this image

At least that's working for me so far. I'm happy to submit a PR or add additional evidence if needed.

Any thoughts from the devs?

1hitsong commented 1 year ago

@ApexArray You were 100% on the money for us needing to move the findnode functions up. However, the core fix for this is checking if the m.rating node exists is valid before we reference it in the removeChild function.

ApexArray commented 1 year ago

However, the core fix for this is checking if the m.rating node exists is valid before we reference it in the removeChild function.

This wouldn't have made a difference in my scenario. The exception occurred on m.star.visible = true. because the star node had already been (properly) deleted for that episode. Let me know if I'm missing anything there.

I started working on this here https://github.com/ApexArray/jellyfin-roku/tree/fix-tv-show-listing-crash. I'll check for any similar issues in the other components and open a PR.

P.S. Most of my experience is with private/closed source development, and I'm still new to open source collaboration. I welcome any feedback on communication/issue/PR etiquette. 😊