-
Notifications
You must be signed in to change notification settings - Fork 35
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
fix: fix copy of copied classes #3857
Conversation
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.
In general it's ok.
Just one question:
maybe it's better to create $copyIdentifier
in the doCopy
method instead of creating it higher and providing to each call of this method? Because as far as I can see all the needed args are also available inside. And this will make changes way less intrusive.
@@ -96,9 +96,18 @@ public function copy( | |||
private function doCopy( | |||
core_kernel_classes_Class $class, | |||
core_kernel_classes_Class $destinationClass, | |||
bool $keepOriginalPermission = true | |||
bool $keepOriginalPermission = true, | |||
string $copyIdentifier = '', |
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.
I prefer to use null
as default instead of empty string 🙂
string $copyIdentifier = '', | |
?string $copyIdentifier = null, |
Version
There are 0 BREAKING CHANGE, 0 feature, 5 fixes |
TL;DR: Maybe this can be solved by simply declaring I think this happens because the class copier is instantiated once by a given worker and then it "remembers" the IDs for the classes it copied for prior requests. And I think this happens because the service is instantiated once from the DI container and then reused for each task run by the worker, so wouldn't it be easier to just declare the services form the DI container as non-shared so their state is not remembered across invocations (here)? Specifically, I think this may be happening because Note here the problem is caused by having a service that is statefull ( |
Will be closed for solving it as @hectoras proposed. |
https://oat-sa.atlassian.net/browse/ADF-1545
We need to fix the possibility of copying already copied classes.
How to test: