Skip to content

Conversation

@vol4onok
Copy link
Contributor

@vol4onok vol4onok commented Jun 20, 2025

Release Table

Module Release Type Constraint Updates
EventBehavior minor

Module EventBehavior

Change log

Improvements

  • Adjusted TriggerManager to avoid duplicate event messages with the same IDs.
  • Adjusted EventBehavior to use correct PrimaryKey in propel module for event message if the table doesn't have primary key.
  • Increased Kernel version dependency.
  • Increased Propel version dependency.

@snyk-spryker
Copy link
Collaborator

snyk-spryker commented Jun 20, 2025

🎉 Snyk checks have passed. No issues have been found so far.

code/snyk check is complete. No issues have been found. (View Details)

Copy link
Contributor

@gechetspr gechetspr left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In the changelogs Propel must be with the capital first letter

"spryker/event": "^2.4.0",
"spryker/event-dispatcher-extension": "^1.0.0",
"spryker/kernel": "^3.49.0",
"spryker/kernel": "^3.72.0",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why kernel version bump? not sure how changes in the module require newer version. Same goes for Propel module too

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

versions outdated, previous CI didn't work

"spryker/testify": "^3.42.0",
"spryker/transfer": "^3.25.0"
"spryker/testify": "^3.58.0",
"spryker/transfer": "^3.39.0"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same here. I don't see how improved array validation is relevant for the changes in the code

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the same

}
$eventEntityTransfersByEvent[$data[EventBehavior::EVENT_CHANGE_NAME]][] = $eventEntityTransfer;
$keyId = is_int($id) || is_string($id) ? $id : spl_object_id($eventEntityTransfer);
$eventEntityTransfersByEvent[$data[EventBehavior::EVENT_CHANGE_NAME]][$keyId] = $eventEntityTransfer;
Copy link
Contributor

@gechetspr gechetspr Jul 3, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A few things with this code that need to be checked.
we have a triggeredRows var lower. Now we can have this number bigger than actual events that we trigger.
If we fix that, please check event records deletion code as it delete those if amount of triggered events in the same as amount of fetched events.

And one more thing that is not related to this code. Could you please check why we have triggerEvents method called and afterward we have a method that trigger events once again and remove them in the loop? Why to trigger events twice?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  1. Not relevant for deleting. We can't delete the same entity twice.
  2. for bulk operations.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

but what about $triggeredRows var? Now it will lie to us as we trigger less events

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good point. let me adjust code

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Adjusted logic. It's not related to these changes. triggeredRows always === count(events)

@vol4onok vol4onok changed the title Adjusted logic FRW-10501 Filter duplicate event entities. Jul 3, 2025
@spryker-release-bot spryker-release-bot merged commit 51f845e into master Jul 3, 2025
5 checks passed
@spryker-release-bot spryker-release-bot deleted the bugfix/frw-10501/master-filter-duplicate-event-entities branch July 3, 2025 13:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Development

Successfully merging this pull request may close these issues.

6 participants