Skip to content

Cannot assign domain to new content item after deleting ancestor of old content with same domain #20655

@D-Inventor

Description

@D-Inventor

Which Umbraco version are you using?

16.3.3

Bug summary

When I delete an ancestor of content with a domain assigned to it, I cannot add that same domain to a different content item. I receive an error that says that the domain is used by another content item, even though that content item is deleted, along with its ancestors.

Specifics

This error happens in the backoffice, but also when using the Management API from an external integration. In my specific case, I create content scenario's for acceptance testing, in which I delete all content in the content tree and recreate it to ensure consistent state. I get an HTTP 409 response with a message that the domain is used, even though the content was just deleted. I can recreate this error in the backoffice with simple content editing:

Image

After restarting the website, I am able to assign the domain, so it seems that this issue is related to a stale in-memory cache somewhere.

Steps to reproduce

  1. Create one or more content types in the backoffice. Ensure that you can create a content tree with at least one root node and one child node
  2. Create a content tree with one root node and one child node
  3. Assign a domain to the child node, for example "localhost:44376"
  4. Throw the root node (the one that DOES NOT have the domain assigned) into the trashcan
  5. Empty the trashcan
  6. Recreate the content tree
  7. Attempt to assign the same domain to the new child node
  8. Observe the error message

Expected result / actual result

I expect, when a node with an assigned domain is deleted, I can assign the domain to a new content item. Instead, I receive an error message that I cannot assign the domain, even though I should.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions