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: race condition when creating a Node #57

Merged
merged 1 commit into from
Feb 16, 2024

Conversation

leogermani
Copy link
Contributor

Both Newspack_Ads_GAM and Hub\Nodes classes were hooking on save_post when a Node was created / updated.

Depending on the order in which plugins were loaded, the GAM class would try to access the node metadata before it was created, because their hook was called earlier.

This PR fixes this race condition.

Instead of changing the priority of the add_action, I suggested that we created a dedicated new action, so we don't risk of making the same mistake again.

@leogermani leogermani requested a review from a team as a code owner February 16, 2024 14:25
@leogermani leogermani merged commit 0a28c99 into alpha Feb 16, 2024
3 checks passed
@matticbot
Copy link
Contributor

🎉 This PR is included in version 1.2.0-alpha.3 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

@matticbot
Copy link
Contributor

🎉 This PR is included in version 1.2.0 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants