Repository navigation
Report an error when the autoload value cannot be stored - #696
Conversation
set_autoload() ignored the result of $wpdb->update(), so a failed query still printed success. It is now also reached from `wp option update` when only the autoload value changes. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01UWTd5pwpi2xQfDA6mUYkkx
|
No actionable comments were generated in the recent review. Walkthrough
Merge Risk:
|
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
Follow-up to #689, from a CodeRabbit "outside diff range" finding on that PR that came in after it was merged.
set_autoload()ignored the result of$wpdb->update(), so when the database rejected the write (read-only replica, lost connection, etc.)wp option set-autoloadstill printed "Success: Updated autoload value…" and exited 0. Since #689,wp option update --autoload=…with an unchanged value goes through the same code.It now errors with
Could not update autoload value for '<option>' option.before touching the caches.The new scenario makes only that UPDATE fail (a mu-plugin rewrites it via the
queryfilter) and covers bothwp option updateandwp option set-autoload. It fails without the fix (success message, exit 0) and passes with it.option.featureandoption-set-autoload.featurepass locally (MariaDB, WordPress 7.1.5); the scenario was also checked on WordPress 6.5 and SQLite.The other outside-diff finding (the cache being written back instead of deleted, a small race with persistent object caches) overlaps with #688, so it's left for after that lands.
Generated by Claude Code
Summary by CodeRabbit