On my local machine, I updated uSync\DocumentType\Containers\Articles\def.config, committed it, and pulled latest on my staging server. I confirmed that the file was updated.
I then went into the uSync dashboard and clicked "Import".
Once the import was done, uSync\DocumentType\Containers\Articles\def.config reverted to the old version. Also, the doctype wasn't updated like it should have been.
Without looking at the code, here is what I'm guessing what happened. I'm thinking that on clicking "Import" uSync changed the doctype, which raised a "save" event, which uSync was listening to, which caused uSync to write the doctype to disk. However, I'm thinking the changes to the doctype weren't reflected yet in the Umbraco API, so uSync probably used the old version when writing it back to disk. Maybe then uSync read the def.config file in again and changed the doctype to its previous state. This is only a guess however; the underlying issue may be something else.
Yep - bug: need to turn off the attach code during an import (I thought i had).
Just to add to the confusion it actually does update some of the settings, but importing a doctype is a two pass thing, so it imports things like names/descriptions. then because the OnSave triggers mid import the second part imports the old values back.
in trying to optimize it I chose not to store the node object in memory between passes, - doh.
I would as a matter of best practice turn on off attach in the config file (attach = "false") on a system you only intend to copy stuff to. or config files will be saved if anyone makes changed on the target box.
uSync Writes Old def.config on Import
On my local machine, I updated uSync\DocumentType\Containers\Articles\def.config, committed it, and pulled latest on my staging server. I confirmed that the file was updated.
I then went into the uSync dashboard and clicked "Import".
Once the import was done, uSync\DocumentType\Containers\Articles\def.config reverted to the old version. Also, the doctype wasn't updated like it should have been.
Without looking at the code, here is what I'm guessing what happened. I'm thinking that on clicking "Import" uSync changed the doctype, which raised a "save" event, which uSync was listening to, which caused uSync to write the doctype to disk. However, I'm thinking the changes to the doctype weren't reflected yet in the Umbraco API, so uSync probably used the old version when writing it back to disk. Maybe then uSync read the def.config file in again and changed the doctype to its previous state. This is only a guess however; the underlying issue may be something else.
I'm using Umbraco 7.1.4 and this version of uSync (currently the latest version): http://our.umbraco.org/projects/developer-tools/usync/usync/54160-Incorrect-Version-Number-(222-226)
The entries in UmbracoTraceLog.txt seem to support my theory. Here are a few lines:
Yep - bug: need to turn off the attach code during an import (I thought i had).
Just to add to the confusion it actually does update some of the settings, but importing a doctype is a two pass thing, so it imports things like names/descriptions. then because the OnSave triggers mid import the second part imports the old values back.
in trying to optimize it I chose not to store the node object in memory between passes, - doh.
I would as a matter of best practice turn on off attach in the config file (attach = "false") on a system you only intend to copy stuff to. or config files will be saved if anyone makes changed on the target box.
I will apply a fix for this in the next version
this is now fixed in latest release 2.3.0
http://our.umbraco.org/FileDownload?id=12232
is working on a reply...