LPS-41112 Move logic up to avoid having 2 heads #2232
Closed
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Hey Brian,
We need to move the logic up because otherwise we end up having 2 versions of the same page with head = true. The reason why that's happening is because the calls to the service for revert already sets head=true for the right version, and then, after that we call the persistance.update with a page version that also has head=true so even though it was modified in the service, it's also modified in the persistance, and then we end up with 2 head=true
If we move that logic up, the service takes care of everything and we don't need to set again head=false.