-
Notifications
You must be signed in to change notification settings - Fork 608
SyncTask unregisterReceiver error #6558
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
Comments
I found a few problems with this issue:
|
Hi @white123483 , thank you for reaching out. From what I can gather, the ConnectivityChangeReceiver is a BroadcastReceiver that listens for network connectivity changes. When a connection is established, it triggers a SyncTask to perform a background synchronization. It then unregisters itself after triggering the task to avoid unnecessary resource usage. I tried reproducing the issue, however, I did not encounter this RuntimeException. I wonder if it is caused by a race condition. I’ll raise this to our engineers and create a PR for this issue. Thanks! |
Thank you for your reply! I've tried to reproduce this issue as well, but that didn't work either, so far we only have this error in the Google Play Console crash logs, and more than two hundred users have encountered this issue. So I'm not sure of the exact possible reasons for triggering it |
This issue is also occurring in the firebase SDK for Unity (firebase-messaging-unity:12.1.0). Could you please tell me when I can expect a fixed SDK? This error tends to spike after each update of our game, then gradually decrease. Firebase Crashlytics logs show that 96% of crashes occurred in the background, and 75% of crashes occurred on Android 15. Thank you. @lehcar09 |
Hi, I'm not sure why a reviewer wasn't assigned for #6560 but for now we believe we should try to better ensure that we're not hitting any error case here rather than catching and ignoring the exception, that way we don't mask any possible true issue bug that may arise. |
For issue #6558, this is an attempt at fixing the IllegalArgumentException by ensuring that the context we use for registering the SyncTask is the same context we use to unregister the task. Race conditions dont seem like a culprit here since unregister is only triggered by the Receiver itself, which should be only executed synchronously on the main thread.
Thank you for the revision. I have one more question. We are using the Firebase Unity SDK, and I’m wondering if an issue fixed in the firebase-android-sdk repository will also be reflected in the Firebase Unity SDK? @welishr |
Hi folks! we have released the BOM version 30.11.0 that includes the fix for this. That said, I'll be closing this issue now. Let us know if there's any misunderstanding or the issue persists so we can re-open the issue. Thanks! |
For issue #6558, this is an attempt at fixing the IllegalArgumentException by ensuring that the context we use for registering the SyncTask is the same context we use to unregister the task. Race conditions dont seem like a culprit here since unregister is only triggered by the Receiver itself, which should be only executed synchronously on the main thread.
[REQUIRED] Step 2: Describe your environment
[REQUIRED] Step 3: Describe the problem
Steps to reproduce:
I would like to know when com.google.firebase.messaging.SyncTask will be called, because my Google Play console gets task.getContext().unregisterReceiver(this) logging out of the receiver resulting in an error message.
Relevant Code:
The text was updated successfully, but these errors were encountered: