Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TASK: Delete as tag #5463

Draft
wants to merge 4 commits into
base: 9.0
Choose a base branch
from
Draft

Conversation

kitsunet
Copy link
Member

@kitsunet kitsunet commented Feb 9, 2025

Allows for soft deletion and querying the
node correctly within the projection while
marked deleted.

Allows for soft deletion and querying the
node correctly within the projection while
marked deleted.
@mhsdesign
Copy link
Member

okay just for reference: This change implements soft-removal as discussed here under "soft removal of nodes in the graph projection". With that we can solve the bug of not being able to interpret changes inside deleted hierarchies. Further it should also fixe the problem of having nodes moved out of a deleted tree part which is published: #5364.

regarding the implementation: i would say that the change projection should no longer be able to handle the real NodeAggregateWasRemoved due to the sheer complexity (removalAttachmentPoint) and it still being broken after all. So if we introduce the complexity with the deleted tag id say we make that part simpler, to be as stupid as:

Currently 'real' deletions on a workspace are discouraged and not publishable via the neos ui, only a full workspace publish works. Please see to soft delete nodes instead in the neos context.

we could even think about (deprecating) and translating RemoveNodeAggregate in the core to be a TagSubtree(deleted) (like we did for the disable commands) and simultaneously introduce a new kind of removal command like PruneNodeAggregate that reintroduces the previous functionality but with a new invariant that this command is only allowed in the base workspace? That would ensure user workspaces never contain real deleted nodes for now.

regarding the new policy: shouldn't the deleted condition will be hardcoded in the CR Auth Service so in Neos.Neos a subgraph is never fetched with deleted nodes?. For the workspace publishing service we could use the manual way of ->getContentGraph()->getSubgraph(...) and specify no restrictions as we need to see all nodes, disabled and deleted.

@kitsunet
Copy link
Member Author

no longer be able to handle NodeAggregateWasRemoved

I guess we could do that, but wouldn't we need to offer some kind of migration for beta users? Or do we add a huge warning that people should publish/discard workspaces before updating to this?

regarding the new policy: shouldn't the deleted condition will be hardcoded

Mmmm, I am happy to do it either way, deleted could indeed be hardcoded if we wanted. I guess any special use, say a trash can or so, can easily use the low level apis to access it.... Either way would be fine by me.

@@ -52,6 +52,11 @@ public static function disabled(): self
return self::instance('disabled');
}

public static function deleted(): self
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if we make the idea of soft deletion a core concept then we have to explain it here i think and more importantly work out how VisibilityConstraints::default comes into play as the "default" should also not see deleted nodes.

We dont make it a policy because no one should have "Neos.Neos:ContentRepository.ReadDeletedNodes" granted
with the soft deletion - by tagging a node `deleted` - actual node deletions via (NodeAggregateWasRemoved) inside a non-live workspace are not desired in Neos

if we publish a site we will include real removals like that in the publish or discard operation to prevent the change from being orphaned.
Note that the site might not necessarily be the site where the change was made in multisite environments, but we cannot determine the hierarchy for removed nodes and edges.
because nodes are just tagged deleted we can still find them and their ancestors via the subgraph
@mhsdesign
Copy link
Member

okay i got rid of the removal attachment point flag now and also tested it in combination with the neos ui change and the ui e2e tests are fine as well

left open points:

  • using VisibilityConstraints::withoutRestrictions() will now show also removed nodes which is probably not desired in all places where we use it
  • make soft deletion a core concept? TASK: Delete as tag #5463 (comment) (maybe even with high level commands that are translated?)
  • we seem to display the changed tags as raw information in the workspace ui review: TagContentChange(addedTags,removedTags) having here deleted show up will be confusing in this place?
  • how do we want to cleanup all the soft deleted nodes at one point? how can we fetch them and issue deletion commands? ALL workspaces need to be rebased too for this to go in effect

@kitsunet
Copy link
Member Author

kitsunet commented Feb 14, 2025

https://github.com/neos/neos-development-collection/pull/5463/files#diff-7afd4d9a8fcb7259c9136da8cba0e3b5b84fab7f01043a9a3c5ab54c881efc54R233 Should've taken care of the workspace ui problem? I saw that as well and after adjusting this here so that changes are marked as deleted it showed up as deleted in the workspace UI.

@kitsunet
Copy link
Member Author

ok the link doesn't work, but it's in the ChangeProjectino where a if $event->tag == deleted results in a deleted change

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

Successfully merging this pull request may close these issues.

2 participants