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

MONGOID-5836 Don't repeat callbacks for embedded grandchildren. #5933

Merged
merged 3 commits into from
Jan 15, 2025

Conversation

jamis
Copy link
Contributor

@jamis jamis commented Jan 8, 2025

When running the before callbacks on embedded children, the grandchildren were being explicitly processed (when callbacks were cascading). However, the input is already the full list of all children and grandchildren. Processing the grandchildren again results in duplicate callbacks being invoked.

jamis added 2 commits January 8, 2025 16:57
Grandchildren are already accounted for when this is invoked,
because if called when callbacks are cascading, the input is
the full list of all children and grandchildren. Processing
grandchildren recursively here causes them to be processed twice.
@jamis jamis requested review from comandeo-mongo and removed request for comandeo-mongo January 13, 2025 18:30
@jamis jamis marked this pull request as draft January 14, 2025 00:09
@jamis jamis marked this pull request as ready for review January 14, 2025 16:28
@jamis jamis merged commit 8d3c92f into mongodb:master Jan 15, 2025
67 checks passed
@jamis jamis deleted the 5836-duplicate-callbacks branch January 15, 2025 16:39
jamis added a commit to jamis/mongoid that referenced this pull request Jan 15, 2025
…odb#5933)

* MONGOID-5836 don't explicitly process grandchildren

Grandchildren are already accounted for when this is invoked,
because if called when callbacks are cascading, the input is
the full list of all children and grandchildren. Processing
grandchildren recursively here causes them to be processed twice.

* specify python version to address failing mongo-orchestration

* make sure we don't break update callbacks
jamis added a commit to jamis/mongoid that referenced this pull request Jan 15, 2025
…odb#5933)

* MONGOID-5836 don't explicitly process grandchildren

Grandchildren are already accounted for when this is invoked,
because if called when callbacks are cascading, the input is
the full list of all children and grandchildren. Processing
grandchildren recursively here causes them to be processed twice.

* specify python version to address failing mongo-orchestration

* make sure we don't break update callbacks
jamis added a commit to jamis/mongoid that referenced this pull request Jan 15, 2025
…odb#5933)

* MONGOID-5836 don't explicitly process grandchildren

Grandchildren are already accounted for when this is invoked,
because if called when callbacks are cascading, the input is
the full list of all children and grandchildren. Processing
grandchildren recursively here causes them to be processed twice.

* specify python version to address failing mongo-orchestration

* make sure we don't break update callbacks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants