Skip to content

Container may fail to delete when there are reference properties

Summary

This is caused by _test_dependencies_in_container() as can be seen in this snippet:

RT1 = db.RecordType(name="RT1")
RT2 = db.RecordType(name="RT2").add_property(name="prop2", datatype=RT1)
RT3 = db.RecordType(name="RT3").add_property(name="prop3", datatype="LIST<RT1>")
cont12 = db.Container().extend([RT1, RT2])
cont13 = db.Container().extend([RT1, RT3])

deps12 = db.Container()._test_dependencies_in_container(cont12)
deps13 = db.Container()._test_dependencies_in_container(cont13)

assert deps12.pop() == cont12.get_entity_by_name("RT1").id  # Fails
assert deps13.pop() == cont13.get_entity_by_name("RT1").id  # Fails

Expected Behavior

At least these cases should be recognized.

Actual Behavior

They're not.

Steps to Reproduce the Problem

Run the code above.

Specifications

  • Version: Latest dev
  • Platform: Linux
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information