-
-
Notifications
You must be signed in to change notification settings - Fork 224
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
BUGFIX: Invalidate caches correctly after node move changes have been discarded #4291
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||
---|---|---|---|---|
|
@@ -157,6 +157,20 @@ protected function addTagToFlush(string $tag, string $message = ''): void | |||
|
||||
protected function registerAllTagsToFlushForNodeInWorkspace(NodeInterface $node, Workspace $workspace): void | ||||
{ | ||||
// Ensure that we're dealing with the variant of the given node that actually | ||||
// lives in the given workspace | ||||
if ($node->getWorkspace()->getName() !== $workspace->getName()) { | ||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @grebaldi do you think this could be a performance problem when working with a large number >1000 nodes? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Good question :) Context creation itself doesn't strike me as very expensive, so I guess that would not be a problem. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Fyi i was curious when this And i followed a bit the path an it seems its only set when publishing (and then its likely the base workspace of course): neos-development-collection/Neos.ContentRepository/Classes/Domain/Service/PublishingService.php Line 267 in 595fcba
The Maybe we should even consider extending the test There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Ah i see each There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. No wait please ignore the following stuff i think its none sense :D I dont fully understand this yet, but if we only want to ensure that $workspaceContext = $this->contextFactory->create(
array_merge(
$node->getContext()->getProperties(),
['workspaceName' => $workspace->getName()]
)
);
$correctNode = $this->nodeFactory->createFromNodeData($node->getNodeData(), $workspaceContext); but in case that is not our sole goal but we want to really ask the database, so the |
||||
$workspaceContext = $this->contextFactory->create( | ||||
array_merge( | ||||
$node->getContext()->getProperties(), | ||||
['workspaceName' => $workspace->getName()] | ||||
) | ||||
); | ||||
$node = $workspaceContext->getNodeByIdentifier($node->getIdentifier()); | ||||
if ($node === null) { | ||||
return; | ||||
} | ||||
} | ||||
$nodeIdentifier = $node->getIdentifier(); | ||||
|
||||
if (!array_key_exists($workspace->getName(), $this->workspacesToFlush) || is_array($this->workspacesToFlush[$workspace->getName()]) === false) { | ||||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fyi due to this this change needs a proxy cache flush as the Neos Neos
PublishingService
must be rebuild.