Skip to content

[Bug] ArrayRepository always overwrites entries when adding #402

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
edglev opened this issue Mar 4, 2024 · 2 comments · May be fixed by #622
Open

[Bug] ArrayRepository always overwrites entries when adding #402

edglev opened this issue Mar 4, 2024 · 2 comments · May be fixed by #622
Assignees
Labels
Bug Something isn't working

Comments

@edglev
Copy link

edglev commented Mar 4, 2024

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

@edglev edglev added the Bug Something isn't working label Mar 4, 2024
@rela589n
Copy link

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 😐

@rela589n
Copy link

rela589n commented Jun 5, 2025

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.)

@roxblnfk roxblnfk self-assigned this Jun 5, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants