Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Moved item can end up deleted on sync #435

Open
Joentje71 opened this issue Jan 27, 2023 · 1 comment
Open

Moved item can end up deleted on sync #435

Joentje71 opened this issue Jan 27, 2023 · 1 comment

Comments

@Joentje71
Copy link

Do you want to request a feature or report a bug?
Bug

What is the current behavior?
When an item, for instance a template item, is moved between different projects, it can end up deleted on the first sync run. Depending on the Helix layers between which it is moved, it can go wrong. If it is moved from the project layer to a feature, it ends up deleted. But it might be our team that has the unicorn configuration wrong.

If the current behavior is a bug, please provide the steps to reproduce.

  1. existing item under Project.Website (Helix project layer)
  2. move it to Feature.Something project
  3. do a unicorn sync and notice the order in which the projects are synced:
    • first, the feature is synced: the item is [U] by unicorn (I think the update includes the path, among other fields)
    • after that, the Project.Website is synced: the item is [D] by unicorn, "because it did not exist in the serialization provider"

What is the expected behavior?
We would like the item not to be deleted, because it still exists, only in a different project.
I think dependencies cannot solve this easily, because it is not the dependency that creates the problem.
After all, at the same time another item could be moved the other way, from feature to project layer.
Somehow, unicorn should be aware of adds/deletes across different projects

Please mention your Sitecore version and Unicorn version.
Sitecore 10.2.0 and unicorn 4.1.6

@cassidydotdk
Copy link
Member

cassidydotdk commented Jan 27, 2023

You really should have only 1 or at most a couple of Unicorn configurations.

That aside; Unicorn can handle a move across configurations under other circumstances. I think you're possibly stumbling somwhere, in how you execute the above steps. E.g. not ensuring your serialization datastore is kept in sync properly and/or not executing a full sync when required.

existing item under Project.Website (Helix project layer)
move it to Feature.Something project

Aight. So on the instance you're doing this, the .yml file will be deleted from Project.Website and a new .yml file will appear unter Feature.Something

do a unicorn sync and notice the order in which the projects are synced

So the question here is; how did you move your files to the target environment where you now execute this sync? Did you make sure to clean out your deployment target so that the (on local) deleted .yml file from Project.Website got cleared out?

first, the feature is synced: the item is [U] by unicorn (I think the update includes the path, among other fields)

This would suggest you did not.

after that, the Project.Website is synced: the item is [D] by unicorn, "because it did not exist in the serialization provider"

And this is expected behaviour.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants