Skip to content

[Bug]: SoftDelete leaves the deleted entity in the heap as MANAGED #56

Open

Description

@roxblnfk

Describe the bug

After a soft delete the entity stays in the heap as MANAGED, although Listener\SoftDelete intends to remove it: line 29 calls $event->state->setStatus(Node::SCHEDULED_DELETE) under the comment "Node should be removed from heap". With the current cycle/orm that call has no observable effect: with or without it, the soft-deleted entity is still in the heap with status MANAGED after EntityManager::run().

Is this a regression?

Not checked; possibly ORM behaviour changed under the listener.

To Reproduce

  1. Entity with the SoftDelete behavior.
  2. $em->delete($entity)->run();
  3. $orm->getHeap()->get($entity) still returns the node, with status Node::MANAGED; removing line 29 changes nothing.

Expected behaviour

Either the soft-deleted entity leaves the heap, as the comment says, or the line and the comment go, if keeping it in the heap is the intended behaviour.

Media prove

Not applicable.

Database

All of them.

Your environment

cycle/entity-behavior 1.x, src/Listener/SoftDelete.php:29.

Additional context

Found while killing escaped mutants in #55: removing the setStatus() call is a mutant no test can kill.

Activity

  1. added
    status:to be verified
    on Nov 20, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    status:to be verifiedtype:bug

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions