Skip to content

Fix crash when loading offline comments in CommentRepliesSource#13418

Merged
TobiGr merged 1 commit intoTeamNewPipe:refactorfrom
Ecomont:fix/offline-comments-crash
Apr 14, 2026
Merged

Fix crash when loading offline comments in CommentRepliesSource#13418
TobiGr merged 1 commit intoTeamNewPipe:refactorfrom
Ecomont:fix/offline-comments-crash

Conversation

@Ecomont
Copy link
Copy Markdown

@Ecomont Ecomont commented Apr 14, 2026

What is it?

  • Bugfix (user facing)
  • Feature (user facing) ⚠️ Your PR must target the refactor branch
  • Codebase improvement (dev facing)
  • Meta improvement to the project (dev facing)

Description of the changes in your PR

  • Wrapped the network call CommentsInfo.getMoreItems inside a try-catch block in CommentRepliesSource.kt.
  • When an extraction or network exception (like UnknownHostException when offline) occurs during pagination, it now correctly returns a LoadResult.Error(e) instead of crashing the app.
  • This allows Jetpack Compose's Paging 3 to catch the state and display the UI error panel (implemented in CommentSection: Add an error panel #11716) instead of triggering a fatal ACRA crash.

Before/After Screenshots/Screen Record

  • Before: The app immediately crashed when trying to load more comment replies without an internet connection.
  • After: The app catches the exception and displays the standard comment error UI panel with a retry button.

Fixes the following issue(s)

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

@github-actions github-actions Bot added the size/small PRs with less than 50 changed lines label Apr 14, 2026
@ShareASmile ShareASmile added bug Issue is related to a bug comments Anything to do with comments and comment replies under videos/audios rewrite Issues and PRs related to rewrite labels Apr 14, 2026
@github-project-automation github-project-automation Bot moved this to In Progress in Rewrite Apr 14, 2026
Copy link
Copy Markdown
Contributor

@TobiGr TobiGr left a comment

Choose a reason for hiding this comment

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

thank you

@TobiGr TobiGr merged commit dd917ca into TeamNewPipe:refactor Apr 14, 2026
6 checks passed
@github-project-automation github-project-automation Bot moved this from In Progress to Done in Rewrite Apr 14, 2026
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 comments Anything to do with comments and comment replies under videos/audios rewrite Issues and PRs related to rewrite size/small PRs with less than 50 changed lines

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

3 participants