You are viewing a plain text version of this content. The canonical link for it is here.
Posted to oak-issues@jackrabbit.apache.org by "Chetan Mehrotra (JIRA)" <ji...@apache.org> on 2017/05/26 06:52:05 UTC

[jira] [Updated] (OAK-6267) Version restore fails if restore would not change bundling root but changes bundled nodes

     [ https://issues.apache.org/jira/browse/OAK-6267?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Chetan Mehrotra updated OAK-6267:
---------------------------------
    Attachment: OAK-6267-v1.patch

[patch|^OAK-6267-v1.patch] which resolves the issue

BundlingHandler was being passed the "after" state in case of any change. This after state may have been reconstructed all together hence the hidden bundlor config may get lost. 

As a fix the BundlingHandler uses the "before" state now for performing the bundlor config lookup. This should be fine as bundle config is only added for newly added node and never modified for existing node. So lookup from "before" state should be safe

[~catholicon] Would be helpful if you can also review the patch

> Version restore fails if restore would not change bundling root but changes bundled nodes
> -----------------------------------------------------------------------------------------
>
>                 Key: OAK-6267
>                 URL: https://issues.apache.org/jira/browse/OAK-6267
>             Project: Jackrabbit Oak
>          Issue Type: Bug
>          Components: documentmk
>    Affects Versions: 1.6.0
>            Reporter: Vikas Saurabh
>            Assignee: Chetan Mehrotra
>             Fix For: 1.8
>
>         Attachments: OAK-6267-v1.patch
>
>
> Following test case in {{VersionedDocumentBundlingTest}} fails:
> {code}
>     @Test
>     public void restoreVersionedNode() throws Exception{
>         String assetParentPath = "/bundlingtest/par";
>         Node asset = JcrUtils.getOrCreateByPath(assetParentPath + "/foo.png", "oak:Unstructured", "oak:Asset", s, false);
>         Node assetParent = s.getNode(assetParentPath);
>         assetParent.addMixin(JcrConstants.MIX_VERSIONABLE);
>         asset.addNode("jcr:content", "oak:Unstructured");
>         s.save();
>         VersionManager vm = s.getWorkspace().getVersionManager();
>         Version version = vm.checkin(assetParentPath);
>         vm.checkout(assetParentPath);
>         asset.getNode("jcr:content").setProperty("foo1", "bar1");
>         s.save();
>         vm.restore(version, true);
>     }
> {code}
> The important point that needs to happen is that restore process needs to let bundle-root-node ({{/bundlingtest/par/foo.png}}) untouched BUT needs to change a bundled node ({{/bundlingtest/par/foo.png/jcr:content}}).



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)