-
Notifications
You must be signed in to change notification settings - Fork 11
Entities retain relations to removed entities #113
Copy link
Copy link
Open
Description
A relation to another entity isn't removed when the target entity is removed. Entity.getRelationsByKind() continues to return removed entities:
with(geary) {
val entityA = entity()
val entityB = entity()
// Using a random component.
entityA.addRelation(components.noInherit, entityB.id)
entityB.removeEntity()
// Throws .-.
check(entityA.getRelationsByKind(components.noInherit).isEmpty())
}This is disastrous if entity id reuse is enabled.
Additionally, no event is emitted on the entity owning the relation, preventing cleanup without listening to all OnEntityRemoved events and iterating over all entities with that relation (obviously slow).
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels