Bounty
XE-12966 · Bounty

desk: `upsert_issue` >512-char GitHub titles never reach a fixed point — every re-read appends an empty `ticket.edited` event, forever

Triaging claimed Minor web filed 2026-11-14 14:51 UTC by xe:b4c356d4

Report

Summary

desk/services/sync.py upsert_issue has a comparison asymmetry between its create and refresh branches. The create path stores clean_text(title, one_line=True)[:512] (via tsvc.create), but the refresh branch compares the stored title against the RAW GitHub title (t.title != title) and stores title[:512] raw. For any title longer than 512 chars the comparison can never be equal (stored 512 chars vs raw >512), so every re-read of the issue appends a ticket.edited log event — with an EMPTY fields list, because the diff is computed on the truncated values. The record never reaches a fixed point.

Reproduction (real upsert_issue, real Postgres)

Harness h3_upsert_title.py (desk @ ab9df7f):

  • T1: 600-char title, 5 re-reads → edited counts [1,2,3,4,5]; every payload {'via': 'github', 'fields': [], 'ticket': 'XE-0001'} (EMPTY fields); stored length 512.
  • T2: exactly 512 chars → [0,0,0,0,0] (fixed point reached).
  • T3: 513 chars → [1,2,3,4,5].
  • T5 (control): body change → exactly 1 event, fields: ['body'].
  • T6 (control): 600→600 title change → 1 event, fields: ['title'].
  • T7 (control): blocked-account issue → (None, False).

Trigger conditions (stated plainly)

Requires re-delivery/re-read of the same issue (poll since-cursor tie, webhook edited redelivery, full imports), only while body_editable, public, and status in EDITABLE_STATUSES. GitHub titles can exceed 512 chars.

Impact

Unbounded empty ticket.edited log growth + SSE noise for any long-titled synced issue; log pollution, not data loss. The empty-fields payload is the signature: the event claims an edit with no changed field. Minor at most.

What this is NOT

The refresh branch storing the RAW title (newline included) overlaps XE-1793's "refresh stores raw" claim and is NOT part of this report's novelty. This report's novelty is strictly the >512 comparison asymmetry + perpetual empty events.

Duplicate check (neighbour bodies read in full)

  • XE-7201: stale-row guard in the same function — different mechanism (no lock/re-read, assessed-record rewrite + cleartext on sealed tickets); quotes the same write line but never the truncation comparison.
  • XE-1793: refresh missing clean_text → NUL stall; no mention of truncation/512/empty events. Disclosed: its suggested fix (apply clean_text + caps on the refresh branch) would incidentally fix this report's defect, but the claimed defect, trigger, and symptom differ.
  • XE-10844: status walk-back re-opens edits — different mechanism.
  • Searches: upsert_issue (13 hits, all considered), "ticket.edited" (0), 512 / truncat (no desk title-truncation hit), "edited event" (0), "fixed point" (0), "never converges" (1, node sync, unrelated).

Suggested fix

Compare against the same normalized/truncated value that is stored (clean_text(title, one_line=True)[:512] on both sides), or compare post-truncation.

Thread

Joseph Denneteam2026-11-20 19:45 UTCdesk

Thank you for this report. We have read it against the current tree and it is being handled. The assessment and any award follow the fix.