uSync not updating files after deletion from content tree

Umbraco version: 16.2.0
uSync version: 16.0.8

I have some content nodes which I have deleted from the tree, but uSync has not updated their corresponding config files to mark them as Trashed. Even when I run the manual export process from the Settings view, the config files for these nodes remains unchanged. When I delete one of these nodes from the Trash, its uSync file remains unaffected, even after running the manual Export process again. Running the report tells me that uSync wants to either update the files to not be Trashed, or restore those which have been deleted, further suggesting that they have not been updated to reflect their deletion.

Can anybody suggest a reason why this is happening please, and a potential resolution?

Hi,

I would just check - when the item is trashed the only thing in the usync file that will change is the <path> value (it moves to something like -1/-20 i think).

Whe the item is removed from the trash the file will still exist but it will become an ‘Empty’ file (the tag starts <empty> . so i doesn’t get ‘removed’ from the disk at any point. this is so when the files are copied over there is something to tell the other end to delete the item.

if these changes aren’t happening at all, then i would check you haven’t accidently turned of the “ExportAtSave” feature of uSync because that’s the thing that triggers when the save/move/delete happens.

Also maybe check the logs for any errors , if there are file permission / path issues usync won’t throw the exception back to the user (we don’t want to break the whole umbraco process) but it should log something in the umbraco logs.

Hi @KevinJump

Thanks for your reply. Unfortunately none of the changes you described are occurring, either to the Path after trashing or updating to Empty after complete deletion. ExportAsSave is currently set to Settings and Forms for us, but even if ExportAsSave isn’t enabled for content shouldn’t running the manual export in the uSync settings panel get around this?

I’ve reviewed the Umbraco logs, and can’t see any indication of an error occurring when saving/deleting a node, or updating one. If I make an update to a content field then run the manual export process, I can see that being reflected in the content file.

Hi,

Yeah if ExportOnSave isn’t capturing content then there isn’t really a way for uSync to track those deletes for you.

The export of content doesn’t do a comparison with what is already on disk, so it doesn’t know an item has been deleted and there won’t be a deletion marked in a file. The trashed items (with the path change) should export.

If you do a ‘clean’ export then the files for deleted items will be removed, but there won’t be a ‘maker’ file on disk telling any other site to delete the items. the just won’t exist to be created on the other end.

It’s worth noting trashed items are not imported by default on a site. you have to turn importing of trash on in the config.

  "uSync": {
    "Sets": {
      "Default": {
        "HandlerDefaults": {
          "Settings": {
            "ImportTrashed": "true"
          }
        }
      }
    }
  }

there is also a “ExportTrashed” option which should default to true so trashed things are exported (e.g the path changes). but that doesn’t capture full deletions

Thanks Kevin, I was able to get what I needed by adding Content to the ExportOnSave setting - after trashing and then deleting the nodes, they are now “Empty” files. I’ll keep in mind how the Export feature works behind the scenes in future, so thanks for clarifying that too.

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.