Fix failed comment moderation badge rendering#568
Conversation
|
The following accounts have interacted with this PR and/or linked issues. I will continue to update these lists as activity occurs. You can also manually ask me to refresh this list by adding the If you're merging code through a pull request on GitHub, copy and paste the following into the bottom of the merge commit message. To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook. |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## develop #568 +/- ##
=============================================
+ Coverage 71.21% 71.37% +0.16%
- Complexity 1151 1154 +3
=============================================
Files 67 67
Lines 5565 5573 +8
=============================================
+ Hits 3963 3978 +15
+ Misses 1602 1595 -7
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Fixed - Show a failed badge when comment analysis fails. Co-authored-by: ekamran <ekamran@git.wordpress.org> Co-authored-by: dkotter <dkotter@git.wordpress.org>

What?
Keeps failed Comment Moderation analysis visible after the comments page is reloaded.
Why?
When comment analysis fails during lazy analysis, the comments table briefly shows the expected red Failed badge. However, after reloading the page, the same saved
failedanalysis status is rendered as—.This makes a failed analysis look the same as a comment that has not been analyzed.
How?
failedanalysis status in the Sentiment and Toxicity columns.ai-badge--failedstyling.Use of AI Tools
AI assistance: Yes
Tool(s): ChatGPT / Codex
Used for: Repository review, reproduction planning, implementation guidance, test updates, and local verification. I reviewed the changes, tested the behavior locally, and take responsibility for the final submission.
Testing Instructions
_wpai_analysis_statusset tofailed.—.Automated checks run locally:
Screenshots or screencast
Before
Failed analysis is shown immediately after lazy analysis fails, but reloading the comments page changes the same failed status back to
—.After
Failed analysis remains visible as Failed after the comments page is reloaded.