Fixed
Status Update
Comments
as...@google.com <as...@google.com>
as...@google.com <as...@google.com> #2
Sorry forgot to change the issue title to something that makes more sense.
Main question is, can the same instance of a worker be used in multiple places? And if so, it looks like things are broken.
Main question is, can the same instance of a worker be used in multiple places? And if so, it looks like things are broken.
li...@gmail.com <li...@gmail.com> #3
I think the issue here is that we should explicitly disallow more than one instance of the same work request in a chain. What's happening here is correct - each work request runs exactly once.
as...@google.com <as...@google.com> #4
Can you give us a sample app where you see the problems occur? It's a little hard to tell from your logs because both sets of output are using the same exact work requests and it's hard to tell when you enqueued them and what order you're running them in. Did you use them for both the unique and non-unique work?
cj...@gmail.com <cj...@gmail.com> #5
In the last example 2 SnapshotWorkers were run, even though I pass the same instance to both chains.
I think I would expect the same instance to be able to be used multiple times, but runs after it's first would be 'skipped'. What do you think of that concept?
I think I would expect the same instance to be able to be used multiple times, but runs after it's first would be 'skipped'. What do you think of that concept?
as...@google.com <as...@google.com> #6
Only one WorkContinuation.combine() is run per log. Ok I can see about creating a sample app.
cj...@gmail.com <cj...@gmail.com> #7
WorkManager should explicitly disallow situations where a workrequest has the same item as both a prerequisite and a dependent. This is happening in your graphs.
Description
Reproduce
I made a Reproduction Sample:https://github.com/LionZXY/Kotlin220Bug
Steps repoduce:
Actual Behavior: Crash in runtime
Expected Behavior: No crashing
If you change the Kotlin version here to
2.0.10
(or2.0.20-Beta1
), the problem goes awayStack trace (if applicable):