Change theme
Help
Press space for more information.
Show links for this issue (Shortcut: i, l)
Copy issue ID
Previous Issue (Shortcut: k)
Next Issue (Shortcut: j)
Sign in to use full features.
Vote: I am impacted
Notification menu
Refresh (Shortcut: Shift+r)
Go home (Shortcut: u)
Pending code changes (auto-populated)
View issue level access limits(Press Alt + Right arrow for more information)
Unintended behavior
View staffing
Description
Devices/Android versions reproduced on: Google Pixel, P DP4
As presently implemented, setAllConstraintsMet() needs to be called *after* the work is enqueued in WorkManager. If you call setAllConstraintsMet() before the call to enqueue(), the subsequent enqueue() call returns immediately without actually executing the work.
Ideally, the order of events here should not matter -- we should be able to call setAllConstraintsMet() before or after enqueuing the work, particularly when using the SynchronousExecutor. However, if there are technical reasons why the work needs to be enqueued first before setAllConstraintsMet() is called, the documentation should be much plainer about that order-of-execution requirement.
Thanks!