<!-- XE-12966 · desk: `upsert_issue` ›512-char GitHub titles never reach a fixed point — every re-read appends an empty `ticket.edited` event, forever · testnet -->
*Markdown view of <https://bounty.xe.network/XE-12966>. The page is the record; this is the same page for reading.*

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

Verdict
:   published when the fix ships

Tier
:   published when the fix ships

Claimed
:   Minor

Area
:   Other

Duplicate of
:   —

Tracked
:   —

Updated
:   2026-11-20 19:46 UTC

Told
:   2026-11-20 19:45 UTC

### Patches

None linked.

### History

- [627210](https://bounty.xe.network/log/627210) 2026-11-20 19:46 UTC proposal.adopted
- [627209](https://bounty.xe.network/log/627209) 2026-11-20 19:46 UTC ticket.award
- [625803](https://bounty.xe.network/log/625803) 2026-11-20 19:45 UTC proposal.adopted
- [625802](https://bounty.xe.network/log/625802) 2026-11-20 19:45 UTC reply.sent
- [625448](https://bounty.xe.network/log/625448) 2026-11-20 19:45 UTC proposal.adopted
- [625447](https://bounty.xe.network/log/625447) 2026-11-20 19:45 UTC ticket.status new → triaging
- [623959](https://bounty.xe.network/log/623959) 2026-11-20 19:45 UTC proposal.adopted
- [623956](https://bounty.xe.network/log/623956) 2026-11-20 19:45 UTC proposal.adopted
- [623955](https://bounty.xe.network/log/623955) 2026-11-20 19:45 UTC ticket.facts
- [623952](https://bounty.xe.network/log/623952) 2026-11-20 19:45 UTC proposal.adopted
- [623951](https://bounty.xe.network/log/623951) 2026-11-20 19:45 UTC ticket.facts
- [623949](https://bounty.xe.network/log/623949) 2026-11-20 19:45 UTC proposal.adopted

[Full history](https://bounty.xe.network/log?ref=XE-12966) · [JSON](https://bounty.xe.network/v1/tickets/XE-12966) · [markdown](https://bounty.xe.network/XE-12966.md)

### 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 Denne**team2026-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.
