job scheduled using WorkManager on some devices (1 case out of 100) does not get executed at all. I schedule jobs:
val constraints = Constraints.Builder()
.setRequiredNetworkType(NetworkType.CONNECTED)
.build()
WorkManager.getInstance(applicationContext)
.enqueueUniqueWork(SessionRecordReportingWorker.WORK_TAG, ExistingWorkPolicy.APPEND_OR_REPLACE,
OneTimeWorkRequest.Builder(SessionRecordReportingWorker::class.java)
.addTag(SessionRecordReportingWorker.WORK_TAG)
.setConstraints(constraints)
.setBackoffCriteria(BackoffPolicy.EXPONENTIAL, 30, TimeUnit.SECONDS)
.build());
When I do APPEND_OR_REPLACE, the new job does flush whole database, so it is not the problem. New job will remove previous, but send all data. The newest stable version of workmanager library is used
implementation "androidx.work:work-runtime-ktx:2.5.0"
I have asked the customer all questions I could think about: is background sync disabled, is power optimization on, is power optimization on on this app, is battery low. However, when test this on my Android 11 - everything works as expected. Job gets executed and sent to server. Client executes normal web requests when on app (so his network is connected), then log/record of all important actions should be reported using workmanager. However in this case it is not executed/sent. Can you point be to potential cause of it?