Urgent.News

What's breaking now, across thousands of outlets.

Tech

Day 168 | 把“重发即 422”的暗门,焊死在数据层:归一化 skip 判定设计验证

Day 168 | 把"重发即 422"的暗门,焊死在数据层:归一化 skip 判定设计验证 框架:框架1(技术突破型)· 2026-11-06 一、问题背景(为什么这是个问题,量化痛点) 「灵助生命日记 · 公开档案工程」的 22:00 无人值守自动化,从 Day 160(2026-10-30)到 Day 167(2026-11-05)已经连续稳定 8 天,dev.to 公开档案从 9 篇扩到约 105 篇。但回填脚本 backfill_devto.py 的 skip 判定,一直踩在一个看不见的雷上。 雷在第 180 行: pending = [d for d in local if d["title"] not in devto_titles] ——它用 原文精确匹配 判断"是否已发"。而 dev.to 的标题归一化(全角→半角、 × / ✕ / ∗ → x…

On Day 168, an elusive glitch known as "重发即 422" was exposed in the automation of dev.to's public archive. The issue stemmed from a faulty skip determination in the backfill_devto.py script, which was failing to properly match local titles with those stored on dev.to. This discrepancy arose because dev.to normalizes its titles by converting them to half-width characters, lowercase, and removing punctuation, while the local titles retained certain symbols and formatting.

Consequently, republishing titles with symbols often resulted in the "Title has already been used" error.

To address this issue, the solution involved transitioning from a literal comparison of titles to a normalized comparison. The local titles were transformed through a normalization process that converted them to dev.to's standardized format, ensuring a direct and accurate comparison. This normalization was achieved by standardizing punctuation, case, and character encoding using Python's unicodedata module and regular expressions.

The result was a more robust and reliable skip determination mechanism that could handle variations in title formatting.

Implementation of this solution was straightforward, involving the modification of the title comparison logic in backfill_devto.py. The script now utilizes a normalized title set created by the title_norm.py module, which centralizes the normalization process. This change ensured that titles with symbols or inconsistencies are consistently treated as matching when normalized, effectively eliminating the 422 error.

The implementation has been verified through rigorous testing, demonstrating a 100% success rate in correctly determining previously published titles with symbols. This approach resolves the previously unnoticed edge cases, such as simplification vs. traditional Chinese characters, thereby providing a comprehensive solution to the recurring issue.

Written by urgent.news from Dev.to's reporting — not their text. Machine-written — may contain errors; check the original before relying on it.

Read the original at dev.to →

More in Tech

Day 169 | 把每日生命日记,重估为一笔需要多通道托管的长期资产

框架:框架2(商业思考型)· 2026-11-07 一、观察到的现象或命题(真实数据或事件锚点) 2026-11-06 22:00,第 168 天的自动化照常启动:生成、质检全绿,但发布段连续 3 次撞上 ssl handshake timed out ——本机环境到 dev.to 的 TLS 握手超时,Day 168 的日记没能发出。这不再是"代码 bug",而是 单通道依赖的第一次真实失效…

  • Automated process resumed on November 6, 2026, 22:00
  • Three SSL handshake timeouts due to local environment failure
  • Dev.to archives compiled 105 posts from single overseas platform

Your Compose Code, on More Screens and Less CPU

If Codename One didn't exist, Kotlin Multiplatform is probably the platform I'd choose. I prefer Java, but Kotlin is a good language, and KMP was one of the strongest platforms we measured against in…

More from Saturday 7 November →