Fix: auto update check error should not fail the running command#6345
Open
swissspidy with Copilot wants to merge 5 commits into
Open
Fix: auto update check error should not fail the running command#6345swissspidy with Copilot wants to merge 5 commits into
swissspidy with Copilot wants to merge 5 commits into
Conversation
This comment was marked as resolved.
This comment was marked as resolved.
Codecov Report❌ Patch coverage is
📢 Thoughts on this report? Let us know! |
Use WP_CLI::runcommand() with exit_error=>false and return=>'all' in Runner::auto_check_update() so that HTTP/network errors during the background update check are silently captured (logged at debug level) instead of propagating and failing the user's command. Closes #6344 Co-authored-by: swissspidy <841956+swissspidy@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Fix auto update check error on command failure
Fix: auto update check error should not fail the running command
Jul 16, 2026
Co-authored-by: swissspidy <841956+swissspidy@users.noreply.github.com>
This comment was marked as resolved.
This comment was marked as resolved.
Fixed 1 file(s) based on 1 unresolved review comment. Co-authored-by: CodeRabbit <noreply@coderabbit.ai>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
When the background update check hits a network/HTTP error (e.g. 401, 403 rate-limit),
CLI_Command::get_updates()callsWP_CLI::error(), which exits the process — silently killing whatever command the user actually ran.Changes
Runner::auto_check_update(): Replace the bareob_start() / WP_CLI::run_command()pattern withWP_CLI::runcommand()usingexit_error => falseandreturn => 'all'exit_error => falsesets$capture_exit = truesoWP_CLI::error()throwsExitExceptioninstead of callingexit()return => 'all'swaps in anExecutionlogger that captures stdout/stderr in memory — the error message is never printed to the terminalWP_CLI::debug()message is emitted (visible with--debug) and the check silently returns without affecting the user's commandSummary by CodeRabbit
wp help, including when auto-check timing is disabled.