sproutcore/sproutcore — pull request #1291 by mirion (2014-09-26 17:26:06+00:00)
Title: Nested store - Fixes a bug where the changes pushed using writeDataHash are not propagate to the child records hashes and eventually to the corresponding child records from the parent store.

The nested store used to have a strange behavior when handling writeDataHash with child objects. If these objects are materialized (which happens in most of the cases), the newly received parent hash (including child data too) was never propagated to the underlying child hashes. Therefore, the records were never updated, etc. This problem does not exist into the main store, but the behavior should be the same. Therefore I extracted this data propagation into a private function and called it from the NS too.

One step further, when committing the changes from the NS to the main store, the newly written data was never pushed to the main store. The problem was similar, again a different behavior into the NS: the child records were never notified (using dataHashDidChange).

Solution is trivial for both problems. Testing not very straightforward, but I made a simple scenario. If you wonder how I found it, I have an autonomous nested store that at the end of a transaction is receiving from the server an updated hash that was never pushed to the record. The problem was triggered by dataSourceDidComplete that is calling writeDataHash, that itself is the root of the bug.