recloudstream / recloudstream/cloudstream

observe/observeNullable running even when the view is in the background

Open
#2,567 6 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

bug
Dominant language
Kotlin
Stars
10.7k
Forks
1.1k
Avg merge
1d 23h
Merged PRs (30d)
15

Description

Steps to reproduce

Add a print statement to any observe that is called when not on screen. This is nonsensical as observe should only change visible behavior, so updating it when it is out of screen just wastes CPU and is less efficient. This was fixed in QN by using the BaseFragmentHelper binding?.root lifecycle in https://github.com/LagradOst/QuickNovel/commit/e1682d49631afe7b2b8d982761d279b8ba2cf555

Expected behavior

The observe should only trigger when the view/fragment is on screen.

Actual behavior

Any use of the observe function will always invoke the action, even if the fragment is out of view.

Cloudstream version and commit hash

ALL

Android version

ALL

Logcat
N/A
Other details

No response

Acknowledgements
  • I am sure my issue is related to the app and NOT some extension.
  • I have searched the existing issues and this is a new ticket, NOT a duplicate or related to another open issue.
  • I have written a short but informative title.
  • I have updated the app to pre-release version Latest.
  • I will fill out all of the requested information in this form.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by locating the observe and observeNullable implementations and compare their lifecycle handling with the BaseFragmentHelper binding?.root approach in the linked QuickNovel commit. Reproduce the issue with a print statement while a fragment view is off screen, then verify that callbacks stop off screen and resume when the view is visible.

Written by the indexing model from the issue text.

Assessment

Tech stack
android, kotlin
Domain
mobile
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
50/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.