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

fix: trigger after persist callbacks for entities scheduled for insert #822

Merged

Conversation

nikophil
Copy link
Member

@nikophil nikophil commented Feb 17, 2025

Because we're now "scheduling for insert" some entities, and not directly saving them, we should take care of their after persist callbacks differently. The proposal of this PR is to give this responsibility to PersistenceManager

fixes #821

@nikophil nikophil marked this pull request as draft February 17, 2025 19:01
@nikophil nikophil force-pushed the fix/after-persist-and-schedule-for-insert branch from f55a394 to f66a30b Compare February 17, 2025 19:02
* @internal
* @var Parameters|null
*/
protected ?array $normalizedParameters = null;
Copy link
Member Author

@nikophil nikophil Feb 17, 2025

Choose a reason for hiding this comment

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

this is not needed anymore, because we're scheduling entities for insert from an "after instantiate" callback, so we can pass the attributes from there

@nikophil nikophil force-pushed the fix/after-persist-and-schedule-for-insert branch from f66a30b to 705f4e2 Compare February 17, 2025 19:08
@nikophil nikophil marked this pull request as ready for review February 17, 2025 19:08
@nikophil nikophil requested a review from kbond February 17, 2025 20:19
@nikophil nikophil merged commit 2426f3e into zenstruck:2.3.x Feb 24, 2025
66 checks passed
@nikophil nikophil deleted the fix/after-persist-and-schedule-for-insert branch February 24, 2025 07:41
nikophil added a commit to nikophil/foundry that referenced this pull request Feb 24, 2025
* 2.3.x:
  changelog: update [skip ci]
  bot: fix cs [skip ci]
  fix: actually disable persistence cascade (zenstruck#817)
  fix: trigger after persist callbacks for entities scheduled for insert (zenstruck#822)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants