GitHub user okram opened a pull request: https://github.com/apache/tinkerpop/pull/471
TINKERPOP-1506: Optional/Coalesce should not allow sideEffect traversals. https://issues.apache.org/jira/browse/TINKERPOP-1506 `g.V(1).optional(addV())` created 2 vertices, not one. This is because `optional()` was implemented with the branch-step `ChooseStep`. This has been fixed with a custom `OptionalStep`. Test cases added to verify correct behavior. Added to `master/` as this is a breaking change. Though, the previous behavior can easily be deemed a bug. VOTE +1. You can merge this pull request into a Git repository by running: $ git pull https://github.com/apache/tinkerpop TINKERPOP-1506 Alternatively you can review and apply these changes as the patch at: https://github.com/apache/tinkerpop/pull/471.patch To close this pull request, make a commit to your master/trunk branch with (at least) the following in the commit message: This closes #471 ---- commit 40971c95903077d38cb754843eb914b5548f5c1f Author: Marko A. Rodriguez <okramma...@gmail.com> Date: 2016-10-31T18:03:33Z added OptionalStep to be used instead of optional() being backed by ChooseStep. This fixes a side-effect issue. ---- --- If your project is set up for it, you can reply to this email and have your reply appear on GitHub as well. If your project does not have this feature enabled and wishes so, or if the feature is enabled but not working, please contact infrastructure at infrastruct...@apache.org or file a JIRA ticket with INFRA. ---