We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Hello,
I tested out the library I noticed one issue which might need some explaining
By the spec of WorkInfo.State: WorkInfo.State - FAILED Used to indicate that the WorkRequest has completed in a failure state.
I'm not getting this State Failed out of the worker by listening to it with
WorkManager.getInstance().getWorkInfoByIdObservable(workRequest.id)
Dummy worker class below
class UpdateWorker(appContext: Context, params: WorkerParameters) : RxWorker(appContext, params) { . . . override fun createWork(): Single<Result> { val inputValue = inputData.getString(KEY_ID) ?: "" return locaRepository.getById(inputValue) .flatMap { object -> remoteRepository.update(object) } .doOnError { error -> Timber.e(error) } .toSingleDefault(Result.success()) .onErrorReturnItem(Result.failure()) } }
When the API request fails onErrorReturnItem(Result.failure()) is getting called. However
Function throws an error in the stream. Now what I would expect to happen is to receive Observable where WorkInfo.State == Failed.
Is this expected behaviour or could you add ignore error flag here as well ?
The text was updated successfully, but these errors were encountered:
I agree, it should also apply to getWorkDataByIdSingle
getWorkDataByIdSingle
Sorry, something went wrong.
No branches or pull requests
Hello,
I tested out the library I noticed one issue which might need some explaining
By the spec of WorkInfo.State:
WorkInfo.State - FAILED Used to indicate that the WorkRequest has completed in a failure state.
I'm not getting this State Failed out of the worker by listening to it with
Dummy worker class below
When the API request fails onErrorReturnItem(Result.failure()) is getting called. However
Function throws an error in the stream. Now what I would expect to happen is to receive Observable where WorkInfo.State == Failed.
Is this expected behaviour or could you add ignore error flag here as well ?
The text was updated successfully, but these errors were encountered: