Skip to content

Conversation

TobiGr
Copy link
Contributor

@TobiGr TobiGr commented Jul 18, 2025

What is it?

  • Bugfix (user facing)

Description of the changes in your PR

This updates the extractor to the latest version. The Top 50 kiosk has been discontinued by SoundCloud and was removed from the extractor in TeamNewPipe/NewPipeExtractor#1332. This PR adds a migration to remove the corresponding main page tab in case it was present. This PR also fixes the error handling when loading tabs to ensure the application does not crash in case an unexpected error occurs.

Screenshots

grafik

Fixes the following issue(s)

Without this migration we'd get a crash at startup rendering the app unusable.

Stacktrace
FATAL EXCEPTION: main
Process: org.schabi.newpipe.debug, PID: 7205
java.lang.NullPointerException: Attempt to read from field 'org.schabi.newpipe.extractor.linkhandler.ListLinkHandlerFactory org.schabi.newpipe.extractor.kiosk.KioskList$KioskEntry.handlerFactory' on a null object reference in method 'org.schabi.newpipe.extractor.linkhandler.ListLinkHandlerFactory org.schabi.newpipe.extractor.kiosk.KioskList.getListLinkHandlerFactoryByType(java.lang.String)'
	at org.schabi.newpipe.extractor.kiosk.KioskList.getListLinkHandlerFactoryByType(KioskList.java:146)
	at org.schabi.newpipe.fragments.list.kiosk.KioskFragment.getInstance(KioskFragment.java:81)
	at org.schabi.newpipe.settings.tabs.Tab$KioskTab.getFragment(Tab.java:357)
	at org.schabi.newpipe.settings.tabs.Tab$KioskTab.getFragment(Tab.java:313)
	at org.schabi.newpipe.fragments.MainFragment$SelectedTabsPagerAdapter.getItem(MainFragment.java:305)
	at androidx.fragment.app.FragmentStatePagerAdapterMenuWorkaround.instantiateItem(FragmentStatePagerAdapterMenuWorkaround.java:169)
	at androidx.viewpager.widget.ViewPager.addNewItem(ViewPager.java:1010)
	at androidx.viewpager.widget.ViewPager.populate(ViewPager.java:1158)
	at androidx.viewpager.widget.ViewPager.populate(ViewPager.java:1092)
	at androidx.viewpager.widget.ViewPager.onMeasure(ViewPager.java:1622)
	at android.view.View.measure(View.java:26496)
	at android.widget.RelativeLayout.measureChildHorizontal(RelativeLayout.java:735)
	at android.widget.RelativeLayout.onMeasure(RelativeLayout.java:481)
	at android.view.View.measure(View.java:26496)
	at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:6981)
	at android.widget.FrameLayout.onMeasure(FrameLayout.java:194)
	at android.view.View.measure(View.java:26496)
	at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:6981)
	at androidx.coordinatorlayout.widget.CoordinatorLayout.onMeasureChild(CoordinatorLayout.java:760)
	at androidx.coordinatorlayout.widget.CoordinatorLayout.onMeasure(CoordinatorLayout.java:833)
	at android.view.View.measure(View.java:26496)
	at androidx.drawerlayout.widget.DrawerLayout.onMeasure(DrawerLayout.java:1156)
	at android.view.View.measure(View.java:26496)
	at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:6981)
	at android.widget.FrameLayout.onMeasure(FrameLayout.java:194)
	at androidx.appcompat.widget.ContentFrameLayout.onMeasure(ContentFrameLayout.java:145)
	at android.view.View.measure(View.java:26496)
	at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:6981)
	at android.widget.LinearLayout.measureChildBeforeLayout(LinearLayout.java:1608)
	at android.widget.LinearLayout.measureVertical(LinearLayout.java:878)
	at android.widget.LinearLayout.onMeasure(LinearLayout.java:721)
	at android.view.View.measure(View.java:26496)
	at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:6981)
	at android.widget.FrameLayout.onMeasure(FrameLayout.java:194)
	at android.view.View.measure(View.java:26496)
	at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:6981)
	at android.widget.LinearLayout.measureChildBeforeLayout(LinearLayout.java:1608)
	at android.widget.LinearLayout.measureVertical(LinearLayout.java:878)
	at android.widget.LinearLayout.onMeasure(LinearLayout.java:721)
	at android.view.View.measure(View.java:26496)
	at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:6981)
	at android.widget.FrameLayout.onMeasure(FrameLayout.java:194)
	at com.android.internal.policy.DecorView.onMeasure(DecorView.java:760)
	at android.view.View.measure(View.java:26496)
	at android.view.ViewRootImpl.performMeasure(ViewRootImpl.java:4042)
	at android.view.ViewRootImpl.measureHierarchy(ViewRootImpl.java:2658)
	at android.view.ViewRootImpl.performTraversals(ViewRootImpl.java:2964)
	at android.view.ViewRootImpl.doTraversal(ViewRootImpl.java:2371)
	at android.view.ViewRootImpl$TraversalRunnable.run(ViewRootImpl.java:9297)
	at android.view.Choreographer$CallbackRecord.run(Choreographer.java:1231)
	at android.view.Choreographer$CallbackRecord.run(Choreographer.java:1239)
	at android.view.Choreographer.doCallbacks(Choreographer.java:899)
	at android.view.Choreographer.doFrame(Choreographer.java:832)
	at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:1214)
	at android.os.Handler.handleCallback(Handler.java:942)
	at android.os.Handler.dispatchMessage(Handler.java:99)
	at android.os.Looper.loopOnce(Looper.java:201)
	at android.os.Looper.loop(Looper.java:288)
	at android.app.ActivityThread.main(ActivityThread.java:7924)
	at java.lang.reflect.Method.invoke(Native Method)
	at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:548)
	at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:936)

APK testing

The APK can be found by going to the "Checks" tab below the title. On the left pane, click on "CI", scroll down to "artifacts" and click "app" to download the zip file which contains the debug APK of this PR. You can find more info and a video demonstration on this wiki page.

Due diligence

@TobiGr TobiGr added bug Issue is related to a bug soundcloud Service, https://soundcloud.com/ labels Jul 18, 2025
@TobiGr TobiGr added this to v0.28.x Jul 18, 2025
@github-project-automation github-project-automation bot moved this to Todo in v0.28.x Jul 18, 2025
@github-actions github-actions bot added the size/small PRs with less than 50 changed lines label Jul 18, 2025
@TobiGr TobiGr removed the status in v0.28.x Jul 18, 2025
@TobiGr TobiGr moved this to In Progress in v0.28.x Jul 18, 2025
@github-actions github-actions bot added size/medium PRs with less than 250 changed lines and removed size/small PRs with less than 50 changed lines labels Jul 18, 2025
@TobiGr TobiGr force-pushed the soundcloud/top_50 branch 2 times, most recently from 93818ba to 3c50f42 Compare July 18, 2025 10:16
@litetex
Copy link
Member

litetex commented Jul 18, 2025

LGTM, however:
Shouldn't there be a general safety check that so that this can never happen?

@TobiGr TobiGr force-pushed the soundcloud/top_50 branch from 3c50f42 to 128ead8 Compare July 18, 2025 16:45
@TobiGr TobiGr force-pushed the soundcloud/top_50 branch from 128ead8 to 95f2ab1 Compare July 18, 2025 17:06
@TobiGr
Copy link
Contributor Author

TobiGr commented Jul 18, 2025

Yes, there are some kind of safe-guards, but they do not work as expected. I fixed that in b42f3ce.

@TobiGr TobiGr force-pushed the soundcloud/top_50 branch from 95f2ab1 to b42f3ce Compare July 18, 2025 17:09
} catch (final ExtractionException e) {
} catch (final Exception e) {
ErrorUtil.showUiErrorSnackbar(context, "Getting fragment item", e);
// TODO: show an error fragment instead
Copy link
Member

@litetex litetex Jul 18, 2025

Choose a reason for hiding this comment

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

Not sure if this is ready yet (PR says ready for review and is no draft so I assume yes)

But this should be addressed before merging ;)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I think that this can be done later / on the refactor branch. I don't have time for that now, but if you want to implement this, fell free to do so ;)

Copy link
Member

Choose a reason for hiding this comment

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

Fixed

image

Copy link
Member

@litetex litetex Jul 19, 2025

Choose a reason for hiding this comment

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

I think that this can be done later / on the refactor branch. I don't have time for that now, but if you want to implement this, fell free to do so ;)

Code is not an issue tracker, please open a issue for this ;)

Update: Nevermind Stypox left a comment 500ms before I submitted mine lol

@litetex litetex mentioned this pull request Jul 18, 2025
11 tasks
Copy link
Member

@AudricV AudricV left a comment

Choose a reason for hiding this comment

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

The message change approach may be generic, as we will have the same behavior with YouTube's changes.

Could we also make the dialog not dismissable by clicking outside but only on the OK button? As we show it only once, it could be missed by users who tapped by mistake. This is a bit of dark pattern UX though.

@TobiGr TobiGr force-pushed the soundcloud/top_50 branch from b42f3ce to fe58ec8 Compare July 19, 2025 11:38
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.

I implemented the error panel in BlankFragment. The rest LGTM. Thanks!

@Stypox Stypox merged commit 0db859e into dev Jul 19, 2025
5 checks passed
@github-project-automation github-project-automation bot moved this from In Progress to Done in v0.28.x Jul 19, 2025
@TobiGr TobiGr deleted the soundcloud/top_50 branch July 19, 2025 19:04
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 size/medium PRs with less than 250 changed lines soundcloud Service, https://soundcloud.com/

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

4 participants