To ensure the event's presence, the implementation was adding the task
as a dependency. It was however setting up this dependency with the
waited-on event in success and remove_when_done set, which means that
the child was removed after the wait no matter what.
This changes the handling so that all code paths go through explicit
when_unreachable / on handling instead of using the dependency relation
to handle the checks. Moreover, it generates a unique role name so that
the dependency can be removed while leaving the existing relations
unchanged.
To ensure the event's presence, the implementation was adding the task as a dependency. It was however setting up this dependency with the waited-on event in success and remove_when_done set, which means that the child was removed after the wait no matter what.
This changes the handling so that all code paths go through explicit when_unreachable / on handling instead of using the dependency relation to handle the checks. Moreover, it generates a unique role name so that the dependency can be removed while leaving the existing relations unchanged.