Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[bug][android][newarch] setTimeout no longer updates once app is minimized #2392

Closed
lovegaoshi opened this issue Nov 5, 2024 · 6 comments
Closed
Labels

Comments

@lovegaoshi
Copy link
Contributor

lovegaoshi commented Nov 5, 2024

Describe the Bug
setTimeout no longer updates once app is minimized. I've confirmed this is directly related to RNTP and new arch interaction, as I tested on my newArchExample repo with RN 0.75.3 + the 2 headlessJs patches, and RNTP + the 2 new arch patches, and can reproduce the issue.

In the repo provided, look at the counter at the very top, it increases by 1 every second. by minimizing and re-opening the app, it wont count anymore. If headlessJs is not involved I believe the counter works.

This is important bc useProgress uses setTimeout to pool progress updates.

Steps To Reproduce
ook at the counter at the very top, it increases by 1 every second. by minimizing and re-opening the app, it wont count anymore

Code To Reproduce
https://github.com/lovegaoshi/RNTPExampleNewArch/tree/eb1707c04b85f1095355f998d6de46ead72a5d72

Replicable on Example App?
yes

Environment Info:
specifically on android

How I can Help
n/A

@lovegaoshi lovegaoshi added the Bug label Nov 5, 2024
@lovegaoshi
Copy link
Contributor Author

lovegaoshi commented Nov 5, 2024

ive pinned down to mActiveTasks.add(taskId); in haedlessJsTaskContext.java that affects the hook behaviors

clearFrameCallback in JavaTimerManager.py. seems like

      mReactChoreographer.removeFrameCallback(
          ReactChoreographer.CallbackType.TIMERS_EVENTS, mTimerFrameCallback);
      mFrameCallbackPosted = false;

needs to be always called, instaed of only when there is no active headlessTask.

since this function is called onHostPause, which is minimizing the app, the behavior is expecetd - tho i dont have a clue what any of this do

@lovegaoshi
Copy link
Contributor Author

proposed patch? lovegaoshi/azusa-player-mobile@57025b9

@lovegaoshi

This comment was marked as off-topic.

@lovegaoshi
Copy link
Contributor Author

tracked by facebook/react-native#47436

@lovegaoshi lovegaoshi changed the title [bug][android][newarch] useEffects no longer updates once app is minimized [bug][android][newarch] setTimeout no longer updates once app is minimized Nov 6, 2024
@lovegaoshi
Copy link
Contributor Author

tracked by facebook/react-native#47496

@lovegaoshi
Copy link
Contributor Author

tracked by reactwg/react-native-releases#617

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant