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

Bug Fixed EventLogBag modification pipe's interaction with different models #1304

Conversation

sha-phpnerd
Copy link

As LogsActivity::$changesPipes is static, this stays in memory and interacts with other model's events.

Scenario :
I used the below function to add more LoggablePipe to modify my EventLogBag, but this was keeping the LoggablePipes into the memory and those LoggablePipes were modifying the other model's event EventLogBags.

    public static function addLogChange(LoggablePipe $pipe): void
    {
        static::$changesPipes[] = $pipe;
    }

So, I've cleared the LoggablePipes after each log write. Simply added

    protected static function bootLogsActivity(): void
    {
        ....
        ....
            // Clear pipelines for each event to avoid interact other model events;
            static::$changesPipes = [];
        ....
        ....
    }

as it has by default, that fixed my issue.

@sha-phpnerd sha-phpnerd changed the title Fixed EventLogBag modification pipe's interaction with different models Bug Fixed EventLogBag modification pipe's interaction with different models May 30, 2024
@github-actions github-actions bot added the stale label Jun 21, 2024
@github-actions github-actions bot closed this Jun 28, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant