Skip to content

Conversation

AudricV
Copy link
Member

@AudricV AudricV commented Sep 15, 2024

  • I carefully read the contribution guidelines and agree to them.
  • I have tested the API against NewPipe.
  • I agree to create a pull request for NewPipe as soon as possible to make it compatible with the changed API. Not needed, the API changes are on code that is not a part of the API that users should use (that's the case of NewPipe).

This PR fixes the ability to serialize ReadyChannelTabListLinkHandlers for YouTube channels. It was due to the usage of the channelHeader field of YoutubeChannelExtractor, as explained in TeamNewPipe/NewPipe#11356 (comment). Even if this usage has been removed by copying the instance members into a new object, the ChannelHeader class of YoutubeChannelHelper was not serializable, so crashes would still happen if I didn't make this class serializable.

Optional as fields and parameters of methods have been removed in the related extractor code as it is not a good practice. This simplifies in some places channel info extraction code.

This PR and the issue it fixes also raise the question of the limits of the serialization system we use, both in the app and in the extractor.

Debug NewPipe APK based on app commit 035c394cf6704c0af9077c01ebfa55b810d02140 with changes from commit 422df70: app-debug.zip

Fixes TeamNewPipe/NewPipe#11356.

@AudricV AudricV added bug Issue is related to a bug youtube service, https://www.youtube.com/ labels Sep 15, 2024
Copy link
Member

@Stypox Stypox left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice catch! I can't really reproduce the crash on NewPipe, but it totally makes sense that it might happen. Thank you for noticing and fixing!

@AudricV AudricV force-pushed the yt_fix-videos-channel-tab-linkhandler-serialization branch from 422df70 to 597eaee Compare September 16, 2024 11:46
Also remove usage of Optional as fields as it is not a good practice. This
simplifies in some places channel info extraction code.
@AudricV AudricV force-pushed the yt_fix-videos-channel-tab-linkhandler-serialization branch from 597eaee to 42c1afa Compare September 29, 2024 13:39
@AudricV AudricV merged commit eb30316 into TeamNewPipe:dev Sep 29, 2024
3 of 4 checks passed
@AudricV AudricV deleted the yt_fix-videos-channel-tab-linkhandler-serialization branch September 29, 2024 13:58
@ShareASmile ShareASmile mentioned this pull request Nov 7, 2024
6 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Issue is related to a bug youtube service, https://www.youtube.com/

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[YouTube] Crashes related to channels serialization (playing a video after some time, going to another app or to settings, ...)

2 participants