53665[BUGFIX] Consider property clean if lazy loaded proxy is untouched
Commit message
Review
-
Code review CR +2
- Andreas Wolf +2
- Claus Due +1
- Tomas Norre Mikkelsen +1
-
Verified V +2
- Benni Mack +2
- Claus Due +1
- TYPO3com +1 CI
Issues 1
Files 10
- typo3/sysext/extbase/Classes/DomainObject/AbstractDomainObject.php5+18 −2
- typo3/sysext/extbase/Classes/Persistence/Generic/LazyLoadingProxy.php1+9 −0
- typo3/sysext/extbase/Tests/Functional/Fixtures/Extensions/blog_example/Configuration/TCA/Overrides/fe_users.php+2 −2
- typo3/sysext/extbase/Tests/Functional/Fixtures/Extensions/blog_example/Configuration/TCA/tx_blogexample_domain_model_blog.php+1 −1
- typo3/sysext/extbase/Tests/Functional/Fixtures/Extensions/blog_example/Resources/Private/Language/locallang_db.xml+1 −1
- typo3/sysext/extbase/Tests/Functional/Persistence/Fixtures/blogs.xml+2 −0
- typo3/sysext/extbase/Tests/Functional/Persistence/Fixtures/fe_users.xml1+11 −2
- typo3/sysext/extbase/Tests/Functional/Persistence/IsDirtyTest.php11new+151 −0
- typo3/sysext/extbase/Tests/Functional/Persistence/OperatorTest.php+1 −1
- typo3/sysext/extbase/Tests/Functional/Persistence/QueryParserTest.php+2 −2
Review log 4261
Show 2436 earlier messages
-
Matthias Vogel uploaded patch set 1 08/09/17, 13:03
-
TYPO3com voted on patch set 1 V +1 08/09/17, 13:16 Completed build in 12m 34s on Wed, 9 Aug, 03:16 PM Test Summary: 57432 passed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-13607
-
Markus Hölzle voted on patch set 1 CR +1 08/09/17, 14:05
-
Tymoteusz Motylewski commented on patch set 1 CR -1 08/09/17, 14:37
Can you add a sentence or two in the commit message, to explain it better?please also add 8.7 or even 7.6 if the issue extists there too. -
Claus Due commented on patch set 1 08/09/17, 16:31
AbstractDomainObject.php:278If the property is a *triggered* LazyLoading object it could be dirty, afaik. So it is necessary with a check for that. -
Tymoteusz Motylewski commented on patch set 1 08/09/17, 17:07
AbstractDomainObject.php:278Replywhat do you mean by "triggered"? -
Matthias Vogel uploaded patch set 2 08/21/17, 14:50
-
TYPO3com voted on patch set 2 V -1 08/21/17, 14:50 Completed build in 08s on Mon, 21 Aug, 04:50 PM Test Summary: No tests found Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-13872
-
Matthias Vogel uploaded patch set 3 08/21/17, 15:00
-
TYPO3com voted on patch set 3 V +1 08/21/17, 15:12 Completed build in 12m 22s on Mon, 21 Aug, 05:12 PM Test Summary: 57776 passed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-13873
-
Tymoteusz Motylewski commented on patch set 3 CR -1 08/21/17, 15:33
IsDirtyTest.php:84can't you just use "assertFalse" and remove the negation?IsDirtyTest.php:89same here -
Tymoteusz Motylewski commented on patch set 3 08/21/17, 15:34
please add a blank line after the commit header -
Tymoteusz Motylewski commented on patch set 3 08/21/17, 15:37
IsDirtyTest.php:81Let's split this test into 2 tests, and give them good names, like: objectFetchedFromDbIsNotDirtyIsDirtyTest.php:87i'm not sure what this part of test is showing us. -
Matthias Vogel uploaded patch set 4 08/22/17, 08:49
-
TYPO3com voted on patch set 4 V -1 08/22/17, 08:49 Completed build in 09s on Tue, 22 Aug, 10:49 AM Test Summary: No tests found Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-13889
-
Matthias Vogel uploaded patch set 5 08/22/17, 08:50
-
TYPO3com voted on patch set 5 V +1 08/22/17, 09:03 Completed build in 13m 02s on Tue, 22 Aug, 11:03 AM Test Summary: 57779 passed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-13890
-
Matthias Vogel uploaded patch set 6 08/22/17, 09:15
-
TYPO3com voted on patch set 6 V -1 08/22/17, 09:39 Completed build in 23m 44s on Tue, 22 Aug, 11:39 AM Test Summary: 1 of 58142 failed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-13894
-
TYPO3com voted on patch set 6 V +1 08/22/17, 11:26 Completed build in 2h 34m 13s on Tue, 22 Aug, 01:26 PM Test Summary: 57779 passed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-13894
-
Tymoteusz Motylewski commented on patch set 6 CR -1 08/22/17, 11:39
Thanks, Matthias, much better now. However I still don't get few things. Would you mind replaying to my comments?AbstractDomainObject.php:279can you describe a little bit why we need this "_loadFakeInstance" method at all?IsDirtyTest.php:95I still don't get this test. Why do we test result of using mock function "_setProperty("? You don't do that in real projects. -
Matthias Vogel commented on patch set 6 08/22/17, 12:05
AbstractDomainObject.php:279ReplyWe do not want to query the database for the real Object so we get a fake instance were only the type and uid is real.IsDirtyTest.php:95ReplyWe use dynamic getter and setter and that is the same as _setProperty(). For performance responses we insert a LazyLoadingProxy into the Model and than compare it with ->_isDirty if it needs an update in the database. -
Markus Hölzle commented on patch set 6 08/22/17, 13:43
I would not create instances to compare them. We don't know what happens in the constructor. Can we compare the LazyObjects without creating an instance of the real type? Furthermore I would suggest more test cases: Compare two LazyObjects, compare lazy with real object, real object with a lazy object and two real objects. -
Matthias Vogel uploaded patch set 7 08/22/17, 14:05
-
TYPO3com voted on patch set 7 V -1 08/22/17, 14:05 Completed build in 08s on Tue, 22 Aug, 04:05 PM Test Summary: No tests found Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-13914
-
Matthias Vogel uploaded patch set 8 08/22/17, 14:26
-
TYPO3com voted on patch set 8 V -1 08/22/17, 14:26 Completed build in 09s on Tue, 22 Aug, 04:26 PM Test Summary: No tests found Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-13915
-
Matthias Vogel uploaded patch set 9 08/22/17, 14:27
-
TYPO3com voted on patch set 9 V +1 08/22/17, 14:40 Completed build in 13m 23s on Tue, 22 Aug, 04:40 PM Test Summary: 57794 passed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-13916
-
Markus Hölzle commented on patch set 9 08/23/17, 10:01
AbstractDomainObject.php:286Would move this checks into the if part (line 292) -
Matthias Vogel uploaded patch set 10 08/23/17, 10:09
-
Markus Hölzle voted on patch set 10 CR +1 08/23/17, 10:17
-
TYPO3com voted on patch set 10 V +1 08/23/17, 10:22 Completed build in 13m 01s on Wed, 23 Aug, 12:22 PM Test Summary: 57733 passed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-13960
-
Claus Due updated the commit message in patch set 11 08/23/17, 10:54
-
Claus Due commented on patch set 11 08/23/17, 10:58
I fixed the commit message, but I gotta say, I'm not so sure about this patch. Take the following case as example: * I load object A which has a 1:n lazy loaded property * I call $objectA->getMyProperty() to get the lazy loading proxy (untouched) * I now load object B which is the same type but a different UID * I call $objectB->setMyProperty($lazyProxy) Question: is $objectB::$myProperty now dirty? My immediate reaction: yes, it most definitely is, because the 1:n relationship needs to be persisted to change the parent to the UID of $objectB. How does that situation play out with this patch? -
TYPO3com voted on patch set 11 V +1 08/23/17, 11:06 Completed build in 11m 34s on Wed, 23 Aug, 01:06 PM Test Summary: 57733 passed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-13962
-
Matthias Vogel updated the commit message in patch set 12 08/23/17, 11:11
-
Matthias Vogel commented on patch set 12 08/23/17, 11:13
IsDirtyTest.php:136This tests for your case. Same type but not same uid. -
TYPO3com voted on patch set 12 V -1 08/23/17, 11:23 Completed build in 12m 03s on Wed, 23 Aug, 01:23 PM Test Summary: 1 of 58096 failed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-13964
-
TYPO3com voted on patch set 12 V +1 08/23/17, 11:29 Completed build in 29m 26s on Wed, 23 Aug, 01:29 PM Test Summary: 57733 passed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-13964
-
Claus Due commented on patch set 12 08/23/17, 11:33
IsDirtyTest.php:105Assertion is dirty=true so either the method is incorrectly named (indicating a possible problem with the behavior) or the assertion is wrong (indicating a possible problem with the code).IsDirtyTest.php:136ReplyThis is not the case I described. My case involves two objects loaded from the Repository and moving the 1:n related objects from one to the other object, then persisting the second object (the one that has the 1:n relation now). My concern is this won't update the members of the lazy loading proxy (leaving the related objects still related to the first object). The test below tests if replacing the same property on the same object with a new instance marks the property dirty. IIRC it does have an effect whether the LazyLoadingProxy is newly created or returned from a Repository, so that case should be covered as well. -
Matthias Vogel uploaded patch set 13 08/23/17, 11:55
-
TYPO3com voted on patch set 13 V -1 08/23/17, 12:19 Completed build in 23m 11s on Wed, 23 Aug, 02:19 PM Test Summary: 8 of 58096 failed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-13965
-
Matthias Vogel uploaded patch set 14 08/24/17, 14:29
-
TYPO3com voted on patch set 14 V +1 08/24/17, 14:43 Completed build in 13m 49s on Thu, 24 Aug, 04:43 PM Test Summary: 57745 passed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-13994
-
Matthias Vogel commented on patch set 12 08/28/17, 15:21
IsDirtyTest.php:105ReplyOh thanks, I have change it to isDirty()IsDirtyTest.php:136ReplyI have change the test. Now it tests if the object is dirty and if it is saved into the Database correctly. -
Markus Hölzle voted on patch set 14 CR +1 09/07/17, 07:39
-
Matthias Vogel rebased onto patch set 15 09/14/17, 08:13
-
TYPO3com voted on patch set 15 V +1 09/14/17, 08:27 Completed build in 13m 56s on Thu, 14 Sep, 10:27 AM Test Summary: 58161 passed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-14928
-
Benni Mack uploaded patch set 16 11/28/17, 12:11
-
TYPO3com voted on patch set 16 V -1 11/28/17, 12:24 Completed build in 13m 15s on Tue, 28 Nov, 01:24 PM Test Summary: 6 of 57239 failed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-16798
-
Christian Kuhn rebased onto patch set 17 11/28/17, 12:26
-
TYPO3com voted on patch set 17 V +1 11/28/17, 12:53 Completed build in 26m 56s on Tue, 28 Nov, 01:53 PM Test Summary: 56880 passed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-16808
-
Tomas Norre Mikkelsen commented on patch set 17 CR +1 11/30/17, 10:28
fe_users.xml:22Why is this important to change the username for the text fixtures ? :) -
Andreas Wolf commented on patch set 17 CR +2 11/30/17, 19:54
LazyLoadingProxy.php:96should this probably be renamed to getIdentityString()? -
Claus Due commented on patch set 17 CR +1 V +1 12/04/17, 01:34
I just gave this patch a quick manual test, applied on a 8.7 with an insanely big model that is literally full of lazy relation properties. The speedup is (subjectively, measured by eye) around 300%, possibly even more, when persisting these objects after they are created. This definitely gets my stamp of approval. I do not agree that the LazyLoadingProxy method should be renamed to _getIdentityString. This *might* cause confusion with the "table:123" format - and this format is "ClassName:123", plus the DataMapper method that gets called, is also named with "Type". Current name is perfectly consistent. -
Andreas Wolf commented on patch set 17 12/06/17, 13:40
Claus, you're totally right. I misinterpreted it as "table:uid" myself. -
Claus Due commented on patch set 17 12/06/17, 13:49
> Claus, you're totally right. I misinterpreted it as "table:uid" myself. It really is a super easy mistake to make because 99% of times it's "table:uid". It isn't nice of Extbase to use this "class:uid" format but one can see why using the table name here wouldn't work (e.g. supporting multiple types in the same table). -
Benni Mack voted on patch set 17 V +2 12/09/17, 21:50
-
Gerrit merged patch set 17 12/09/17, 21:50
-
Benni Mack commented on patch set 18 12/09/17, 21:50
Cherry Picked This patchset was cherry picked to branch TYPO3_8-7 as commit e3a0d0912c987451ace61f44c1ed9426d8eb3cec