Fixed
Status Update
Comments
ra...@google.com <ra...@google.com> #2
This is a hard one. We can't easily read native crashes from that Motorola device since their system image is not public. I assume you can't reproduce this either, but if possible can you try using WorkManager 2.0.0 or 1.0.1-rc01? This would help track down the possible changes that might have introduced this issue. Thanks!
ap...@google.com <ap...@google.com> #3
We actually did reproduce it, the current store version of Pocket Casts has WorkManager 2.0.0 and this bug if you want to try and test something. I will try 1.0.1-rc01 and report back.
[Deleted User] <[Deleted User]> #4
Is there a difference between 1.0.1 and 2.0.1? We tried 2.0.1 and it was crashing, if there is a difference I can try 1.0.1 but I thought they were the same?
Description
Version used: alpha09
Devices/Android versions reproduced on:
When using WorkContinuation.combine to join multiple works before continuing, it has a check in it to make sure it's acutally combining multiple WorkContinuations. I think this check is uneccessary and annoying, and adds a hard to find bug in implementations. The combine() method could easily just do nothing if there's only a single WorkContinuation passed to it.
Current use case:
I'm uploading a number of photos, which I'm splitting into a number of WorkContinuation lists so that several happen in parallel. If I only have one photo to upload then obviously I can only split this into one list of work, and the app crashes because WorkContinuation.combine() 'cannot' combine a single item. To fix this I have to have this code:
```
val allCombined = if (workLists.size == 1) workLists[0] else WorkContinuation.combine(workLists)
allCombined.then(....
```
which is much less nice than the original code which I think should work:
```
WorkContinuation.combine(workLists)
.then(....
```