SitecoreUnicorn/Rainbow

Updated items are not published

kristofferkjeldby opened this issue · 6 comments

Hi

After upgrading to Rainbow.Storage.Sc 2.1.1.0 (Sitecore 9.2.0) we are facing an issue where items with updated field values are not published during Unicorn sync.

I have traced the issue to Rainbow/src/Rainbow.Storage.Sc/Deserialization/DefaultDeserializer.cs line 649 - if I am reading the code correctly, this should be a catch block, not a finally block?

Please tell me more about the specific issue you are experiencing, including any error logs if present. Also, are you running Unicorn with it, and if so which version?

Hi Cassidy

Sure. We are running a pretty standard Helix/Habitat setup using Rainbow 2.1.1 and Unicorn 4.1.1 with autopublish.

What we are seeing is that an update to a shared field triggers a publish whereas a update to a versioned field does not. I have create a simple test item having shared and a versioned field and added it to a predicate. When changing the the shared field, Unicorn writes out:

Project.Standard is being synced with Dilithium SQL + Serialized enabled.
* [U] SharedField
[U] master:/sitecore/content/TestItem (b2a9f499-9f54-4503-a014-ef88163c81a5)
> Field SharedField - Serialized 'SharedField2', Source 'SharedField1'
Project.Standard sync complete: 83 items evaluated, 1 item modified (0 added, 1 updated, 0 recycled) in 2940ms (~35,43ms/item).

But if we change the versioned field:

Project.Standard is being synced with Dilithium SQL + Serialized enabled.
* [U] da#1: VersionedField
Project.Standard sync complete: 82 items evaluated, 0 items modified (0 added, 0 updated, 0 recycled) in 3364ms (~41,03ms/item).

As you can the, the actual field is updated, but the item is not flagged as changed, and hence not published.

I am pretty sure that if you compare the methods PasteSharedFields and PasteVersion in the deserializer, you'll find that the commitEdit is set to false in the finally block and returned, whereas the commitEdit is returned before the finally block in the PastesSharedFields method. The means that the PasteVersion method will never mark items as changed. I may be overlooking some additional logic, but it seems strange to me.

Best regard
Kristoffer

Can you try this without Dilithium, please? it ends up on a very different execution path with Dilithium enabled.

Hi again

I have tried with and without Dilithium - it makes no difference.

Best Regard
Kristoffer

Hi Guys,

I have created a Pull Request with a fix for this one here #39