Skip to content
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

Skips model event listeners, causing issues in transaction repository #1013

Open
cr998 opened this issue Dec 29, 2024 · 1 comment
Open

Skips model event listeners, causing issues in transaction repository #1013

cr998 opened this issue Dec 29, 2024 · 1 comment
Assignees
Labels
question Further information is requested Stale

Comments

@cr998
Copy link

cr998 commented Dec 29, 2024

Describe the bug
In the transaction repository, the use of saveQuietly() skips all the listeners and prevents them from being triggered, which causes issues with the expected behavior of the application. This behavior is detrimental to the proper flow of the system, as important actions tied to events like saving or saved are not being executed.

//Bavix\Wallet\Internal\Repository\TransactionRepository

public function insertOne(TransactionDtoInterface $dto): Transaction
{
    $attributes = $this->transformer->extract($dto);
    $instance = $this->transaction->newInstance($attributes);
    $instance->saveQuietly(); //<--

    return $instance; 
}

Is the use of this saveQuietly() method necessary for any reason?

@cr998 cr998 added bug Something isn't working question Further information is requested labels Dec 29, 2024
@cr998 cr998 changed the title Skips Model Event Listeners, Causing Issues in Transaction Repository Skips model event listeners, causing issues in transaction repository Dec 29, 2024
@rez1dent3
Copy link
Member

Hello. This is done on purpose, it's not a bug. The package has its own events that you can subscribe your application to.

@rez1dent3 rez1dent3 added Stale and removed bug Something isn't working labels Jan 2, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested Stale
Projects
None yet
Development

No branches or pull requests

2 participants