A query example:
Here, CountStrategy tries to convert count().is(0) to not(...). However, when it is under ConnectiveStrategy, it tries to read Steps from tail to beginning and include Steps until it finds the first non-filter Step. So in this case, it becomes
So the first out("none") is outside of NotStep, whereas the 2nd out() is inside.
The original intention of this query is that the 1st branch under or should return true in the first branch, because there is no such edge with the label "none" and count = 0.
However this optimization returns the opposite result. Because the first VertexStep(OUT,[none],vertex) is now outside of NotStep, the 1st branch returns false.
It seems this logic was intentionally introduced while back ago
So just reverting this change may not be the permanent fix. We should investigate what should be the correct behavior for CountStrategy to apply under ConnectivityStep.