Skip to content

Prevent disconnected nodes when partially publishing a move #3383

Open
@skurfuerst

Description

This issue explains a nasty issue when partially publishing moved nodes, and a bit of proposal how to solve this.

Problem Description

Let's say we have the following Node structure in the beginning:

  |-- site
  . |-- cr
  . | |-- subpage
  . |   |-- nested
  . |-- other

Now, user-demo moves /site/cr/subpage underneath /site/other/ in the user workspace. This means in the
user workspace the following status exists:

  |-- site
  . |-- cr
  .   |-- subpage   SHADOW NODE in user-demo
  .     |-- nested  SHADOW NODE in user-demo
  . |-- other
  .   |-- subpage   user-demo
  .     |-- nested  user-demo

Scenario 1: Publishing a parent page

Now, let's assume user-demo forgets about this (thus not publishing), and a few weeks later needs to do
a text change on subpage.

  |-- site
  . |-- cr
  .   |-- subpage   live + SHADOW NODE in user-demo <--- (2) ... and this is published as well; removing the subpage in live
  .     |-- nested  live + SHADOW NODE in user-demo
  . |-- other
  .   |-- subpage   user-demo <-- (1) only this is published.
  .     |-- nested  user-demo

This leads to the following result:

  |-- site
  . |-- cr
  .   |-- [NODE DOES NOT EXIST ANYMORE]
  .     |-- nested  live + SHADOW NODE in user-demo   <-- !!BUG!!
  . |-- other
  .   |-- subpage
  .     |-- nested  user-demo

The first "nested" node (marked with !!BUG!!) is NOT visible anymore in live, because the parent does not exist
anymore. It's hard to detect this as user-demo, because user-demo sees the moved nested node.

Proposed Change

It must be FORBIDDEN to publish only the "subpage" but NOT its moved children, because that would
directly lead to disconnected and unreachable children.

if 
  - a node is published which is MOVED (has a matching shadow node)
then:
  - go to the original location of the node in the base workspace (e.g. live) - where the shadow node is located.
  - does this original node have children (in the base workspace)? -> if YES, only publishing the single node would lead
     to disconnected children in live. However, when all nested nodes will removed during the publish (e.g. due to publishing the children as well), then is's OK and safe to remove the node.

Scenario 2: Publishing a Child Page

Now, let's assume user-demo forgets about this (thus not publishing), and a few weeks later needs to do
a text change on nested.

  |-- site
  . |-- cr
  .   |-- subpage   live + SHADOW NODE in user-demo
  .     |-- nested  live + SHADOW NODE in user-demo <--- (2) ... and this is published as well; removing the subpage in live
  . |-- other
  .   |-- subpage   user-demo
  .     |-- nested  user-demo <-- (1) only this is published.

This leads to the following result:

  |-- site
  . |-- cr
  .   |-- subpage   live + SHADOW NODE in user-demo
  . |-- other
  .   |-- subpage   user-demo !!BUG!! - This Node does NOT exist in LIVE
  .     |-- nested  live + user-demo

The "nested" node (marked with !!BUG!!) is NOT visible in live, because the parent does not exist
yet. It's hard to detect this as user-demo, because user-demo sees the moved parent.

Proposed Change

It must be FORBIDDEN to publish only the "nested" page but NOT its moved parents, because that would
directly lead to disconnected and unreachable nodes.

Solution Idea

I find this quite hard to fix without side-effects I guess, because we somehow need to check whether we would have
this problem before actually running into this issue.

So ideas how to fix this are welcome - otherwise I'd try it out in the upcoming weeks ;-)

Related: #3384 and neos/neos-ui#2924

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions