Repository navigation
Content Translation: Skip blocks that are removed or replaced mid-translation - #1137
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## develop #1137 +/- ##
==========================================
Coverage 82.17% 82.17%
Complexity 3399 3399
==========================================
Files 136 136
Lines 13187 13187
==========================================
Hits 10837 10837
Misses 2350 2350
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
|
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. |
e843687 to
79ba562
Compare
64047d6 to
cb9f556
Compare
cb9f556 to
6fbdb9c
Compare
What, Why, and How?
Closes #1138
While testing the Content Translation experiment, I found that toggling "Show template" during a translation doesn't stop it, but none of the remaining results are applied. Switching the editor view recreates the post's blocks with new client IDs. The translation keeps sending requests for the old IDs, and each result is silently dropped because those blocks no longer exist, so the requests and tokens are wasted. The same happens when a block is deleted or transformed mid-translation, and in every case the dropped blocks were still counted as translated.
Rather than watching for specific triggers like the rendering mode, this PR checks whether each block still exists:
Also, Generate Editorial Notes seems to rely on block client IDs and may have the same problem (untested as of now). That should be handled in a separate PR.
Use of AI Tools
AI assistance: Yes
Tool(s): Claude Code
Model(s): Opus 5.5
Used for: Reviewing the code and stress testing the changes.
Screencast
screencast.mov
Changelog Entry