[Bug] ArrayRepository always overwrites entries when adding
What are you really trying to do?
Prevent multiple activities with the same name
Describe the bug
Registering multiples of the same activity does not throw ERROR_ALREADY_EXISTS.
ArrayRepostiory's add method checks a non-existing array with isset($this->prototypes[$name]) and is always false, overwriting entries regardless of $overwrite argument specified
Also stumbled upon this.
Actually this add() method never takes into account second parameter:
/**
* Register a new {@see Identifiable} inside the repository.
*/
public function add(Identifiable $entry, bool $overwrite = false): void;
I see that in many places it's passed as false explicitly, and in some places it's just omitted. Yet, I've never seen it to be true.
Though, current behavior is as if it always was true 😐
Hi, @wolfy-j ,
This is quite sever bug, since right now it tolerates naming collisions basically everywhere (including workflow names, activity names, worker task queues, etc.)