In all cases when we need to manipulate and assign the latest value regarding versioning flows we have a race condition.
Notice that we perform queries prior to the bulk that handles the switch of the latest flag for objects.
Those queries can be obsolete in case of changes in parallel after the queries and prior to the bulk updates.
Which means that we do not actually query and change in a bulk and do that separately.
Expected behavior
We should be able to handle this by locks or bulks that include the query as well
Steps to reproduce
1.
Screenshots or Logs or other output that would be helpful
Environment info
Actual behavior
Expected behavior
Steps to reproduce
1.
Screenshots or Logs or other output that would be helpful