GooglePlayDriver: doesn't reschedule Jobs after App is updated. #6
Comments
Hey! Is this still an issue? I want to use the library in production. I've got the library working like I want it too but reading this issue has got me worried. |
Yes, this is still happening. We have an internal issue tracking this (the fix needs to happen in Google Play services), but the fix hasn't been launched yet. For now, as a workaround, I recommend scheduling all your jobs sometime during your initialization phase with shouldReplaceCurrent set to false: https://github.com/firebase/firebase-jobdispatcher-android/blob/0.5.0/jobdispatcher/src/main/java/com/firebase/jobdispatcher/JobParameters.java#L82 |
On this page, it's written that Google Play Services has an |
is this an issue with recurring job only or with one time scheduled job also, i have used this in my project and wondering if this is happening in one time scheduled job as well then that will create issues and i have to look for alternates. |
When this critical issue will see a fix? I'm going to advocate against this library if usability issues big like this one take months (closer to a year in fact) to be solved here! |
@ciarand Do you know how jobs can be automatically rescheduled here ? |
Has this issue been fixed yet? |
If anyone is still facing this issue, a workaround I found is what LouisCAD touched on. Create a stub GcmTaskService, that does nothing in OnRunTask, and override OnInitializeTasks function to perform all re-scheduling. |
@summersmichael any example code you can share? |
@aftabsikander here:
Then register it in the manifest as usual:
|
@ciarand @SUPERCILEX @ogeidix @googolmo @jenzz @michaeldiener @vRallev @unEgor ping contributors. |
As a workaround you could listen to ACTION_MY_PACKAGE_REPLACED and reschedule your job onReceive. |
@ciarand I'm ringing the bell. What's the progress on your internal issue on this? |
@ciarand Also, why is this issue marked as unassigned? |
Hi, |
Hi, |
That makes sense, @LouisCAD. The current version of Google Play services does not cancel FJD jobs when the app is updated, which matches the behavior of the platform job scheduler. There was a bug in older versions where it would, but it was fixed in the February release (v9). We were waiting for market penetration before closing this, but it ended up falling off our radar. If the onInitializeTasks behavior + pre-v9 compat is important, it's probably much easier just to listen for your MY_PACKAGE_REPLACED broadcast instead of the onInitializeTasks, no? That saves you the hassle of including the GCM package and is ultimately a better solution from the system's perspective. |
@ciarand Thanks for letting us know the status of this issue! We had really no information about this before. |
@ciarand do you consider this closed? |
Is the market penetration good enough now (in October 2018) to consider that problem solved? I'm considering using Firebase JobDispatcher and the workaround is non-trivial. |
In April 2019 we announced that Firebase Job Dispatcher would be deprecated today, April 7th 2020. For this reason we are going to close all open issues and archive the repository. We will also stop supporting FJD for new app installations (such as those targeting sdk versions greater than Android Q). Existing apps that rely on FJD should continue to function as usual. While we will no longer work on FJD, we encourage you to migrate to Work Manager which is a superior tool and fully supported by the Android team. Thank you for taking the time to try the library and provide this feedback. We sincerely appreciate your effort and we apologize for not addressing it in time. |
GooglePlayDriver doesn't reschedule Jobs after Google Play Services or the app is updated.
GooglePlayReceiver has check for that situation in onStartCommand, but it doesn't handle this case correctly. All Jobs should be rescheduled.
To Reproduce issue:
The text was updated successfully, but these errors were encountered: