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

WIP 5150 flush content cache correctly #5160

Closed

Conversation

mhsdesign
Copy link
Member

@mhsdesign mhsdesign commented Jun 23, 2024

Experimental possible alternative to #5155

Resolves: #5150

The discard tests of the neos ui will pass (#5150)

Upgrade instructions

Review instructions

Checklist

  • Code follows the PSR-2 coding style
  • Tests have been created, run and adjusted as needed
  • The PR is created against the lowest maintained branch
  • Reviewer - PR Title is brief but complete and starts with FEATURE|TASK|BUGFIX
  • Reviewer - The first section explains the change briefly for change-logs
  • Reviewer - Breaking Changes are marked with !!! and have upgrade-instructions

@github-actions github-actions bot added the 9.0 label Jun 23, 2024
mhsdesign and others added 4 commits June 23, 2024 11:28
…orkspace doesnt exist anymore

```
Scenario: When a change is applied to the forked content stream AFTER the fork, it is not visible in the live content stream. # Features/ContentStreamForking/ForkContentStreamWithoutDimensions.feature:61
      And the event NodePropertiesWereSet was published with payload:                                                             # Features/ContentStreamForking/ForkContentStreamWithoutDimensions.feature:66
        Neos\ContentRepository\Core\SharedModel\Exception\WorkspaceDoesNotExist: The source workspace user does not exist
```
The test scenario consists of a document with a main content collection
that initially contains two simple text content nodes.

During the scenario, we switch to a user workspace and insert a third
text node between the two initial nodes. The test then verifies, that
fusion renders all three text nodes in order.

Afterwards we discard the change we just made and check whether fusion
now stops rendering the discarded node. Confirming neos#5150, with this
commit, said verification fails.
Discarded node move changes are reflected correctly in the document tree
Scenario neos#2: Moved nodes do not just disappear after discarding the move change
Comment on lines +138 to +147
if ($eventInstance instanceof WorkspaceWasPartiallyDiscarded) {
foreach ($eventInstance->discardedNodes as $discardedNode) {
$this->scheduleCacheFlushJobForNodeAggregate(
$this->contentRepository,
$eventInstance->workspaceName,
$discardedNode->nodeAggregateId
);
}
}

Copy link
Member Author

Choose a reason for hiding this comment

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

fixes one ui test

FIX #3184: Discarded node move changes are reflected correctly in the document tree
Scenario #2: Moved nodes do not just disappear after discarding the move change

$workspace = $this->contentRepository->getWorkspaceFinder()->findOneByCurrentContentStreamId($eventInstance->getContentStreamId());
if ($workspace === null) {
try {
$contentGraph = $this->contentRepository->getContentGraph($eventInstance->workspaceName);
Copy link
Member Author

Choose a reason for hiding this comment

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

using $eventInstance->workspaceName fixes most of the ui discard failures

@mhsdesign
Copy link
Member Author

So the ui is green with this but now the new NodesInUserWorkspace.feature tests (thanks Wilhelm) dont pass at all ... neither for WorkspaceWasPartiallyDiscarded nor on WorkspaceWasDiscarded ...

@dlubitz
Copy link
Contributor

dlubitz commented Aug 31, 2024

As this is fixed now properly, I close this one.

@dlubitz dlubitz closed this Aug 31, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

BUG: Discarded node remains in cache if UI was reloaded between creation and discard
3 participants