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

After upgrading RN from 0.73.6 to 0.76.3 HeadlessTask stopped working #541

Open
ovgamesdev opened this issue Nov 26, 2024 · 4 comments
Open
Labels

Comments

@ovgamesdev
Copy link

ovgamesdev commented Nov 26, 2024

Your Environment

  • Plugin version: 4.2.5
  • Platform: Android
  • OS version: 10
  • Device manufacturer / model: Oppo A5 (2020)
  • React Native version (react-native -v): npm:react-native-tvos@~0.76.3-0
  • Plugin config

Dependencies

{
	"@notifee/react-native": "^9.1.3",
	"@react-native-async-storage/async-storage": "^2.1.0",
	"@react-native-community/netinfo": "^11.4.1",
	"@react-native-google-signin/google-signin": "^13.1.0",
	"@react-navigation/bottom-tabs": "^6.6.1",
	"@react-navigation/material-top-tabs": "^6.6.14",
	"@react-navigation/native": "^6.1.18",
	"@react-navigation/native-stack": "^6.11.0",
	"@reduxjs/toolkit": "2.3.0",
	"@robinbobin/react-native-google-drive-api-wrapper": "^1.2.4",
	"@shopify/flash-list": "^1.7.2",
	"merge-options": "^3.0.4",
	"react": "^18.3.1",
	"react-native": "npm:react-native-tvos@~0.76.3-0",
	"react-native-background-fetch": "^4.2.5",
	"react-native-blob-util": "^0.19.11",
	"react-native-bootsplash": "^6.3.2",
	"react-native-config": "^1.5.3",
	"react-native-error-boundary": "^1.2.7",
	"react-native-gesture-handler": "^2.21.2",
	"react-native-keyboard-controller": "1.14.2",
	"react-native-logs": "5.2.2",
	"react-native-modal": "^13.0.1",
	"react-native-offline": "^6.0.2",
	"react-native-pager-view": "^6.5.1",
	"react-native-quick-base64": "2.1.2",
	"react-native-reanimated": "^3.16.3",
	"react-native-safe-area-context": "^4.14.0",
	"react-native-screens": "^4.3.0",
	"react-native-svg": "^15.9.0",
	"react-native-tab-view": "^3.5.2",
	"react-native-unistyles": "^2.20.0",
	"react-native-webview": "^13.12.4",
	"react-redux": "9.1.2",
	"rn-update-apk": "^5.0.0",
	"semver": "^7.6.3"
}

Expected Behavior

Get the ‘[BackgroundFetch HeadlessTask] response: JSON’ answer

Actual Behavior

Happens ‘HeadlessMode? true’ and ‘onHeadlessJsTaskStart: 1’ after that there is no action

Steps to Reproduce

  1. update from RN 0.73.6 to RN 0.76.3 and BF 4.2.3 to 4.2.5

Debug logs

full logcat drive.google.com

11-27 00:36:19.382 26705 26705 D TSBackgroundFetch: ☯️  onCreate
11-27 00:36:19.438 26705 26705 D TSBackgroundFetch: ☯️  HeadlessMode? true
11-27 00:36:25.396 26705 27240 D TSBackgroundFetch: [RNBackgroundFetch initialize]
11-27 00:36:27.586 26705 26705 D TSBackgroundFetch: onHeadlessJsTaskStart: 1
11-27 00:36:33.474 26705 27251 E unknown:ReactNative: Exception in native call from JS
11-27 00:36:33.474 26705 27251 E unknown:ReactNative: com.facebook.react.common.JavascriptException: Exception in HostFunction: Could not enqueue microtask because they are disabled in this runtime, stack:
11-27 00:36:33.474 26705 27251 E unknown:ReactNative: Error: Exception in HostFunction: Could not enqueue microtask because they are disabled in this runtime
11-27 00:36:33.474 26705 27251 E unknown:ReactNative:     at queueMicrotask (native)
11-27 00:36:33.474 26705 27251 E unknown:ReactNative:     at setImmediate (http://192.168.0.105:8081/index.bundle//&platform=android&dev=true&lazy=true&minify=false&app=com.movieapp&modulesOnly=false&runModule=true&excludeSource=true&sourcePaths=url-server:28955:26)
11-27 00:36:33.474 26705 27251 E unknown:ReactNative:     at handleUpdate (http://192.168.0.105:8081/index.bundle//&platform=android&dev=true&lazy=true&minify=false&app=com.movieapp&modulesOnly=false&runModule=true&excludeSource=true&sourcePaths=url-server:23331:35)
11-27 00:36:33.474 26705 27251 E unknown:ReactNative:     at addIgnorePatterns (http://192.168.0.105:8081/index.bundle//&platform=android&dev=true&lazy=true&minify=false&app=com.movieapp&modulesOnly=false&runModule=true&excludeSource=true&sourcePaths=url-server:23529:17)
11-27 00:36:33.474 26705 27251 E unknown:ReactNative:     at ignoreLogs (http://192.168.0.105:8081/index.bundle//&platform=android&dev=true&lazy=true&minify=false&app=com.movieapp&modulesOnly=false&runModule=true&excludeSource=true&sourcePaths=url-server:23073:37)
11-27 00:36:33.474 26705 27251 E unknown:ReactNative:     at anonymous (http://192.168.0.105:8081/index.bundle//&platform=android&dev=true&lazy=true&minify=false&app=com.movieapp&modulesOnly=false&runModule=true&excludeSource=true&sourcePaths=url-server:1129:33)
11-27 00:36:33.474 26705 27251 E unknown:ReactNative:     at loadModuleImplementation (http://192.168.0.105:8081/index.bundle//&platform=android&dev=true&lazy=true&minify=false&app=com.movieapp&modulesOnly=false&runModule=true&excludeSource=true&sourcePaths=url-server:267:14)
11-27 00:36:33.474 26705 27251 E unknown:ReactNative:     at guardedLoadModule (http://192.168.0.105:8081/index.bundle//&platform=android&dev=true&lazy=true&minify=false&app=com.movieapp&modulesOnly=false&runModule=true&excludeSource=true&sourcePaths=url-server:168:47)
11-27 00:36:33.474 26705 27251 E unknown:ReactNative:     at metroRequire (http://192.168.0.105:8081/index.bundle//&platform=android&dev=true&lazy=true&minify=false&app=com.movieapp&modulesOnly=false&runModule=true&excludeSource=true&sourcePaths=url-server:89:92)
11-27 00:36:33.474 26705 27251 E unknown:ReactNative:     at global (http://192.168.0.105:8081/index.bundle//&platform=android&dev=true&lazy=true&minify=false&app=com.movieapp&modulesOnly=false&runModule=true&excludeSource=true&sourcePaths=url-server:237314:4)
11-27 00:36:33.474 26705 27251 E unknown:ReactNative: 	at com.facebook.jni.NativeRunnable.run(Native Method)
11-27 00:36:33.474 26705 27251 E unknown:ReactNative: 	at android.os.Handler.handleCallback(Handler.java:899)
11-27 00:36:33.474 26705 27251 E unknown:ReactNative: 	at android.os.Handler.dispatchMessage(Handler.java:100)
11-27 00:36:33.474 26705 27251 E unknown:ReactNative: 	at com.facebook.react.bridge.queue.MessageQueueThreadHandler.dispatchMessage(MessageQueueThreadHandler.java:27)
11-27 00:36:33.474 26705 27251 E unknown:ReactNative: 	at android.os.Looper.loop(Looper.java:241)
11-27 00:36:33.474 26705 27251 E unknown:ReactNative: 	at com.facebook.react.bridge.queue.MessageQueueThreadImpl.lambda$startNewBackgroundThread$2(MessageQueueThreadImpl.java:217)
11-27 00:36:33.474 26705 27251 E unknown:ReactNative: 	at com.facebook.react.bridge.queue.MessageQueueThreadImpl$$ExternalSyntheticLambda1.run(D8$$SyntheticClass:0)
11-27 00:36:33.474 26705 27251 E unknown:ReactNative: 	at java.lang.Thread.run(Thread.java:919)
11-27 00:36:33.477 26705 27251 E ReactNativeJNI: Attempting to call JS function on a bad application bundle: HMRClient.setup()
@christocracy
Copy link
Member

Yes, the entire RN community is working on this.

I’m working on it.

I suggest you avoid “new architecture” for now.

I’m going to be at least a week working on this

@Alper-Demir-Eng
Copy link

Any updates on new arch?

@mikehardy
Copy link
Contributor

Looks like it's good to go in the latest release
https://github.com/transistorsoft/react-native-background-fetch/blob/master/CHANGELOG.md#426--2024-11-29
340ea10

If you test it, I'd be surprised if it wasn't working. Chris hedged with the estimate of a week and got it almost same day it looks like, this issue might be close-worthy

Copy link

This issue is stale because it has been open for 30 days with no activity.

@github-actions github-actions bot added the stale label Jan 19, 2025
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

4 participants