Skip to content

A broken translation gives up its url to a fresh one - #939

Merged
mircealungu merged 1 commit into
masterfrom
wt/broken-translation
Nov 7, 2026
Merged

mircealungu merged 1 commit into
masterfrom
wt/broken-translation

Conversation

@mircealungu

Copy link
Copy Markdown
Member

The audit tool marks wrong-language article translations broken so that the next reader gets a fresh one (tools/audit_stored_article_languages.py says so), but that didn't work:

  • /translate_and_adapt_article and /article_upload/<id>/translate_and_adapt served the broken translation from the #translated-from url cache.
  • The two friend-share paths skipped it, then hit the unique key on article.url_id inserting the replacement at the same url.

All four now use Article.find_usable_translation. A broken translation moves to <url>-broken-<id>, which frees the url for the new one and still holds #translated-from-, so its origin can be read. The broken row stays, so a reader who has it open keeps it.

The move happens at lookup, so a failed LLM call afterwards leaves the url free and the next request tries again.

Tests: test_broken_translation.py, one case per path; all 4 fail with the broken check removed. API and core suites pass (1438). No migration, no web change.

🤖 Generated with Claude Code

The audit tool marks wrong-language translations broken so the next reader gets
a new one, but the two translate endpoints served them from the url cache
anyway. The friend-share paths skipped them and then crashed inserting at the
same unique url. All four now go through Article.find_usable_translation.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@github-actions

github-actions Bot commented Nov 7, 2026

Copy link
Copy Markdown

ArchLens - No architecturally relevant changes to the existing views

@mircealungu
mircealungu merged commit 5ec3afa into master Nov 7, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant