Skip to content

Potential UI thread blocking issue #12752

@nbd-boss

Description

@nbd-boss

Checklist

  • I am able to reproduce the bug with the latest version given here: CLICK THIS LINK.
  • I made sure that there are no existing issues - open or closed - which I could contribute my information to.
  • I have read the FAQ and my problem isn't listed.
  • I have taken the time to fill in all the required details. I understand that the bug report will be dismissed otherwise.
  • This issue contains only one bug.
  • I have read and understood the contribution guidelines.

Affected version

v0.28.0

Steps to reproduce the bug

The code calls Room.databaseBuilder(...).build() on the main thread, which performs disk I/O operations.

Expected behavior

No response

Actual behavior

No response

Screenshots/Screen recordings

No response

Logs

No response

Affected Android/Custom ROM version

No response

Affected device model

No response

Additional information

Hello Developer,

I used a static analysis tool to examine NewPipe and found that in PlaylistFragment.java, LocalPlaylistFragment.java, and BookmarkFragment.java, the onCreate methods all invoke getInstance synchronously. However, getInstance calls Room.databaseBuilder(...).build() on the main thread, which performs disk I/O operations and may block the UI thread.

According to Android development best practices, this database initialization should be moved off the UI thread to avoid potential UI freezes.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugIssue is related to a bugneeds triageIssue is not yet ready for PR authors to take upperformanceRelated to performance and optimisation; affects the speed or memory efficiency of the application

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions