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. (backport to 8.0-stable) #5937

Merged
merged 4 commits into from
Jan 24, 2025

Conversation

jamis
Copy link
Contributor

@jamis jamis commented Jan 15, 2025

(Backport to 8.0-stable)

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

This also backports the :prevent_multiple_calls_of_embedded_callbacks feature flag, from MONGOID-5542, so that we can safely prevent duplicate callbacks in a backwards-compatible way.

jamis and others added 4 commits January 15, 2025 15:16
…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
the list of children already includes all descendants
…db#5621) (mongodb#5626)

* Add test

* Fix double callback call

* Change test that expects the old behavior

* Add config option

* Flip the flag
@jamis jamis requested a review from comandeo-mongo January 23, 2025 22:46
@jamis jamis merged commit 1b51522 into mongodb:8.0-stable Jan 24, 2025
45 of 67 checks passed
@jamis jamis deleted the 5836-embedded-callbacks-8.0-stable branch January 24, 2025 17:13
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