-
-
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
TASK: Use proper version checks where applicable #5456
base: 9.0
Are you sure you want to change the base?
TASK: Use proper version checks where applicable #5456
Conversation
Replaces some `ExpectedVersion::ANY()` occurrences with proper versions the decisions were based on. **Note:** With this change there are 8 `ExpectedVersion::ANY()` left in the `WorkspaceCommandHandler` that would require the workspace read model to keep track of the version. There are three more occurrences in `CommandSimulator` and `ContentStreamHandling` that are kept by intention Related: #5058
For the following cases in the
Further i found a few missing |
@@ -148,7 +148,7 @@ private function handleCreateWorkspace( | |||
$command->newContentStreamId, | |||
) | |||
), | |||
ExpectedVersion::ANY() |
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.
this slight change has a big impact as now after deleting a workspace a new one with the exact same name cannot be recreated.
And because \Neos\Neos\Domain\Service\WorkspaceService::getUniqueWorkspaceName
only prevents naming conflict with existing workspaces that are projected attempting to create a workspace with the same title via Ui fails.
steps:
- create workspace 'MyTest'
- delete workspace
- repeat
![image](https://private-user-images.githubusercontent.com/85400359/409493194-1129a827-872d-4479-b520-bdce64276850.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MzkwMjk2MzIsIm5iZiI6MTczOTAyOTMzMiwicGF0aCI6Ii84NTQwMDM1OS80MDk0OTMxOTQtMTEyOWE4MjctODcyZC00NDc5LWI1MjAtYmRjZTY0Mjc2ODUwLnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNTAyMDglMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjUwMjA4VDE1NDIxMlomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPWNjNDFjNDJjYWI3NTQ0NWQ0NzZmN2FlZDhlOWE1NWYzMTYzMmIzOTYxMjg0OTZlMjZhZTJkZTQwY2I2YTA4M2ImWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0In0.HwaR515xSCtm11Nl1UPevW8TdB2Gpk3A4F6cdQPTFGQ)
The error is as expected:
Workspace could not be created.
Expected version: -1 [no stream], actual version: 1
That means imo that getUniqueWorkspaceName
needs to handle this case.
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.
very good catch
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.
So this seems to hve no test then?
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.
jup the the core's DeleteWorkspace
is fully untested - i have that somewhere in my todo list and stumble upon that every once and then. Also the cores CreateWorkspace
is only tested implicit but not for such cases.
Replaces some
ExpectedVersion::ANY()
occurrences with proper versions the decisions were based on.Note: With this change there are 8
ExpectedVersion::ANY()
left in theWorkspaceCommandHandler
that would require the workspace read model to keep track of the version. There are three more occurrences inCommandSimulator
andContentStreamHandling
that are kept by intentionRelated: #5058