{"id":"XE-12966","kind":"bounty","visibility":"public","source":"web","source_repo":"","source_ref":"","source_url":"","reporter_id":2305,"title":"desk: `upsert_issue` >512-char GitHub titles never reach a fixed point — every re-read appends an empty `ticket.edited` event, forever","area":"other","claimed_tier":"minor","assessed_tier":null,"verdict":null,"duplicate_of":null,"tracked":false,"internal_ref":"","internal_url":null,"status":"triaging","closed_reason":null,"github_state":"","disclosed_at":null,"award_xe":null,"award_approved":false,"paid_ref":"","created_at":"2026-11-14T14:51:11.231194+00:00","updated_at":"2026-11-20T19:46:43.801925+00:00","source_created_at":null,"told_at":"2026-11-20T19:45:48.354373+00:00","status_changed_at":"2026-11-20T19:45:43.999855+00:00","url":"https://bounty.xe.network/XE-12966","body":"## Summary\n\n`desk/services/sync.py` `upsert_issue` has a comparison asymmetry between its\ncreate and refresh branches. The create path stores\n`clean_text(title, one_line=True)[:512]` (via `tsvc.create`), but the refresh\nbranch compares the stored title against the RAW GitHub title\n(`t.title != title`) and stores `title[:512]` raw. For any title longer than\n512 chars the comparison can never be equal (stored 512 chars vs raw >512),\nso every re-read of the issue appends a `ticket.edited` log event — with an\nEMPTY `fields` list, because the diff is computed on the truncated values.\nThe record never reaches a fixed point.\n\n## Reproduction (real `upsert_issue`, real Postgres)\n\nHarness `h3_upsert_title.py` (desk @ ab9df7f):\n\n- T1: 600-char title, 5 re-reads → edited counts [1,2,3,4,5]; every payload\n  `{'via': 'github', 'fields': [], 'ticket': 'XE-0001'}` (EMPTY fields);\n  stored length 512.\n- T2: exactly 512 chars → [0,0,0,0,0] (fixed point reached).\n- T3: 513 chars → [1,2,3,4,5].\n- T5 (control): body change → exactly 1 event, `fields: ['body']`.\n- T6 (control): 600→600 title change → 1 event, `fields: ['title']`.\n- T7 (control): blocked-account issue → `(None, False)`.\n\n## Trigger conditions (stated plainly)\n\nRequires re-delivery/re-read of the same issue (poll `since`-cursor tie,\nwebhook `edited` redelivery, full imports), only while `body_editable`,\npublic, and status in EDITABLE_STATUSES. GitHub titles can exceed 512 chars.\n\n## Impact\n\nUnbounded empty `ticket.edited` log growth + SSE noise for any long-titled\nsynced issue; log pollution, not data loss. The empty-`fields` payload is the\nsignature: the event claims an edit with no changed field. Minor at most.\n\n## What this is NOT\n\nThe refresh branch storing the RAW title (newline included) overlaps\nXE-1793's \"refresh stores raw\" claim and is NOT part of this report's\nnovelty. This report's novelty is strictly the >512 comparison asymmetry +\nperpetual empty events.\n\n## Duplicate check (neighbour bodies read in full)\n\n- XE-7201: stale-row guard in the same function — different mechanism (no\n  lock/re-read, assessed-record rewrite + cleartext on sealed tickets);\n  quotes the same write line but never the truncation comparison.\n- XE-1793: refresh missing `clean_text` → NUL stall; no mention of\n  truncation/512/empty events. Disclosed: its suggested fix (apply\n  `clean_text` + caps on the refresh branch) would incidentally fix this\n  report's defect, but the claimed defect, trigger, and symptom differ.\n- XE-10844: status walk-back re-opens edits — different mechanism.\n- Searches: `upsert_issue` (13 hits, all considered), `\"ticket.edited\"` (0),\n  `512` / `truncat` (no desk title-truncation hit), `\"edited event\"` (0),\n  `\"fixed point\"` (0), `\"never converges\"` (1, node sync, unrelated).\n\n## Suggested fix\n\nCompare against the same normalized/truncated value that is stored\n(`clean_text(title, one_line=True)[:512]` on both sides), or compare\npost-truncation.","patch_refs":[],"thread":[{"id":15167,"source":"desk","source_ref":"reply:13059","author":"Joseph Denne","team":true,"body":"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.","created_at":"2026-11-20T19:45:48.345704+00:00"}]}