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

Content/Media not deleted when names are not unique #244

Open
HarrySpyrou opened this issue Oct 2, 2024 · 3 comments
Open

Content/Media not deleted when names are not unique #244

HarrySpyrou opened this issue Oct 2, 2024 · 3 comments

Comments

@HarrySpyrou
Copy link

Describe the bug
Create an image under a folder named 'Images' that already exists in the destination server. uSync then creates an 'Images (1)' folder and puts the images there. When you then try to delete that image and push that change, the Report correctly recognises the image needs to be gone (marks it as something to delete) but when the push actually happens, the target server's image stays put.

That doesn't happen when the folder with the same name doesn't initially exist on the target server. That works fine.

Version (please complete the following information):

  • Umbraco Version: 13.4.1
  • uSync Version: 13.2.5
  • uSync.Complete Version: 13.1.7

To Reproduce
Steps to reproduce the behavior:

  1. Create 'Images' folder on Target server, add a few, not important if you add many or one
  2. Go to Source server. Create 'Images' folder with two images. Push to Target both folder and one image.
  3. Go to Target. uSync must have made an 'Images (1)' folder with the image coming from Source.
  4. Go to Source. delete the pushed image.
  5. Try to push. Report marks it as 'to be deleted'. Complete push. Final report doens't include the 'to be deleted' image.
  6. Go to Target. 'To be deleted' image should be there. That's with a real time publisher.

Also happens with content that's not uniquely named. (E.g name 'Test')

Expected behavior

  1. Delete image when image is requested to be deleted.
  2. Consistency between report and final report (after push).
  3. If 'Images' folder (in our example) exists, don't make Images (1) folder, but push to that specific folder.

Screenshots
Unfortunately can't add screenshots currently as it's an NDA client's project.

@bielu
Copy link

bielu commented Oct 30, 2024

Hey @KevinJump,
I had chance to investigate this issue, issue is related to failure on syncing when there is field required on content, but it was saved without it and it fails on syncing as it fails umbraco validations. I think there should be better warning on failture, to make sure it is shown that other changes weren't applied as syncing failed.

@KevinJump
Copy link
Member

Hi, just checking this, for the issue in the first thing that mostly works* for me?? (but not sure about the required field bit? )

following the steps I get this.

ImagePushDeletePush

* i am not sure about image vs image(1) in the example - because they are technically diffrent folders and that does stop uSync from deleteting a load of things you might not have been expected to be deleted ? - but maybe there are cases where it could merge - lots of nuance in that however so will need to think


second bit - about validated fields, do you have some steps for that ?

it can get a little bit complex there because uSync publisher is (again mostly) using the last published version of a bit of content, so if the content field is removed and saved i think default behavior is that the published one will get sent over again ?

@bielu
Copy link

bielu commented Oct 30, 2024

So let me give you steps:

  • Create media folder
  • add media a and media b
  • sync media folder
  • make required field on media a and make sure it doesnt pass validation on both
  • remove media b on source
  • try to sync media folder
    you will see it doesn't give any feedback for media b which should be removed so it looks like it doesnt work, but it actually works because it prevent further operations as media a failed on sync :)

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

3 participants