-
Notifications
You must be signed in to change notification settings - Fork 802
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
Sync: Callables: Allow shutdown sync on CLI commands #12924
Comments
Hi @nickdaugherty, I wanted to let you know that I've been working on this issue. At this point it's a matter of getting all of the tests passing, which I hope to finish tomorrow. |
Hey @nickdaugherty we've also got the tests to pass, so the PR is also in a testable state right now. We'd appreciate your help in testing/reviewing the PR in order to ship it and resolve the issue as soon as possible. |
@nickdaugherty #13015 has been merged, so this should work now. |
Thanks @gititon, much appreciated! |
Hey @gititon, I did some testing and I don't think it's quite fixed. The changes come through eventually (I'm guessing through cron), but not in direct response to the CLI command itself, it seems. I left a note on the PR, I think we're still not properly doing the sync on shutdown for CLI commands, b/c it aborts if the request isn't Cron (which WP CLI is not). |
Hi @nickdaugherty , can you please try again on master and confirm whether the latest changes do the trick? Thanks! |
Hey @gititon, I just retested on fresh build of master, and there are 2 things not working right for me: The The other problem is that
|
Thanks for your feedback, @nickdaugherty. I'll prepare another patch in the morning to address site_url and give the wait time some thought. For context, can you please tell me why we need these options to bypass normal sync constraints and always sync immediately? |
Hi @nickdaugherty, I have a pull request in that will let siteurl sync as well, and ensures that both siteurl and home sync instantly when changed via WP CLI, #13132. |
Hi @nickdaugherty, #13132 has been merged, so you should have the additional functionality you were looking for now. |
Awesome, I'll try it out as soon as I can. To answer your question, the use case is launching a new site - site has a "placeholder" domain up until the point of DNS switching, then DNS is flipped and the home/siteurls are updated back to back...so it'll start receiving traffic and it's important the cache site is in sync. Technically a delay of a minute or two may be ok, but IMO better to do it straight away. |
Roger that, thanks for filling me in, @nickdaugherty. Please let me know how it works for you when you have a chance. |
Closing this for now since #13132 has been merged. @nickdaugherty Feel free to reopen if there are still issues in your testing. |
Awesome, tested it out and it seems much better. Changing the home/siteurl several times in a row occasionally ended up with out-of-date data on the cache site, but it does seem much more reliable (and |
* Add initial changelog / testing list changes for 7.6 * Update stable tag to 7.5.3 * changelog: add #12957 * Changelog: add #12932 * Changelog: add #12867 * Changelog: add #12823 * changelog: add #12969 * changelog: add #13012 * changelog: add #12974 * Changelog: add #13059 * Changelog: add #13079 * Changelog: add #12924 * changelog: add #12954 * Changelog: add #12959 * Changelog: add #12977 * Changelog: add #12830 * Changelog: add #12926 * Changelog: add #12958 * Changelog: add #12999 * Changelog: add #13077 * Changelog: add #13083 * Changelog: add #13087 * Changelog: add #13110 * Changelog: add #13116 * Changelog: add #13117 * Changelog: add #12821 * Changelog: add #13120 * changelog: add #13139 * Changelog: add #13143 * Changelog: add #13147 * Testing list: add section about sync
* Add initial changelog / testing list changes for 7.6 * Update stable tag to 7.5.3 * changelog: add #12957 * Changelog: add #12932 * Changelog: add #12867 * Changelog: add #12823 * changelog: add #12969 * changelog: add #13012 * changelog: add #12974 * Changelog: add #13059 * Changelog: add #13079 * Changelog: add #12924 * changelog: add #12954 * Changelog: add #12959 * Changelog: add #12977 * Changelog: add #12830 * Changelog: add #12926 * Changelog: add #12958 * Changelog: add #12999 * Changelog: add #13077 * Changelog: add #13083 * Changelog: add #13087 * Changelog: add #13110 * Changelog: add #13116 * Changelog: add #13117 * Changelog: add #12821 * Changelog: add #13120 * changelog: add #13139 * Changelog: add #13143 * Changelog: add #13147 * Testing list: add section about sync
Steps to reproduce the issue
wp option update home https://some-new-domain.com
home
option on WP.com / Jetpack side - it's unchangedhome
is now correct on WP.com / Jetpack sideWhat I expected
Like other content changes that are synced on shutdown, changing options that are handled via "functions/callables" should also cause a sync on shutdown.
What happened instead
The new value was not synced until a sync was manually triggered.
This is because of the conditional here:
jetpack/packages/sync/src/modules/Callables.php
Line 219 in 40e18f0
Related - it also bails on Cron, which doesn't seem great, because then callables are only synced on admin requests - is that still desired?
cc @Automattic/poseidon
The text was updated successfully, but these errors were encountered: