{"id":"XE-13132","kind":"bounty","visibility":"public","source":"web","source_repo":"","source_ref":"","source_url":"","reporter_id":2171,"title":"Desk: removing `fixes #n` from a PR body strands the ticket in `fixing`","area":"other","claimed_tier":"minor","assessed_tier":null,"verdict":"duplicate","duplicate_of":null,"tracked":false,"internal_ref":"","internal_url":"","status":"closed","closed_reason":"duplicate","github_state":"","disclosed_at":null,"award_xe":null,"award_approved":false,"paid_ref":"","created_at":"2026-11-14T17:21:27.260077+00:00","updated_at":"2026-11-20T19:46:06.445147+00:00","source_created_at":null,"told_at":"2026-11-20T19:46:06.480426+00:00","status_changed_at":"2026-11-20T19:46:06.459737+00:00","url":"https://bounty.xe.network/XE-13132","body":"link_pull early-returns when a PR's current title+body contains no #n references — before any PatchRef lookup. The follower that moves a ticket back out of fixing (_follow_pull_state) only ever runs for PRs that currently reference the ticket. So if a PR's body is edited to remove its fixes #n, no later read — webhook edited, webhook closed, or poll — ever revisits that ticket/PR pair: the ticket stays fixing forever against a PR that no longer claims to fix it, and the stale PatchRef row keeps blocking other PRs' move-backs.\r\n\r\nMechanism: link_pull (desk/services/sync.py:259-265) begins: refs = gh.issue_refs(text); if not refs: return 0 — before any PatchRef lookup or _follow_pull_state call. _follow_pull_state (:330-360) is the only code that moves a ticket back when a PR closes unmerged: it requires t.status == \"fixing\" and (trusted or pr.moved_from), and refuses when _other_live_patches reports another live patch. It only runs for PRs that currently reference the ticket. No other code revisits PatchRef.followed — followed writers exist only in sync.py, and tickets_needing_push covers labels/state only.\r\n\r\nReproduction (from code): (1) Maintainer PR #P moves ticket T new → fixing (moved_from recorded). (2) The PR author edits P's body, removing fixes #N. (3) P is closed unmerged → webhook pull_request → link_pull → refs empty → return 0 → _follow_pull_state never runs → T stays fixing forever, with no event, although the PR that moved it is closed and no longer claims to fix it. The same strand occurs if P stays open (T shows fixing against a PR that no longer fixes it). (4) Second-order effect: the stale PatchRef row keeps state=\"open\", so _other_live_patches (:430-445) keeps treating P as a live patch and blocks other PRs' move-backs for T.\r\n\r\nImpact: tickets stuck in fixing with no live fix PR; the team must hand-correct; stale rows poison the live-patch check for other PRs. Minor — workflow/state integrity, no confidentiality or payout impact.\r\n\r\nWhy not a duplicate: XE-1128 is the opposite direction: post-merge edits adding refs force tickets to patched. Its remediation (\"only honor closing refs present at merge time\") does not close this — this is about refs being removed, and about a ticket stranded in fixing, not forced to patched. XE-12446 is the parser over-reading fixes #n inside code blocks and quotes. XE-6996 is cross-repo owner/repo#n refs never being parsed. XE-2080 / XE-0634 are follower dedup / moved_from inheritance. Board search /?q=link_pull (2026-11-14) shows 7 hits — XE-1128, XE-7201, XE-10813, XE-6996, XE-7795, XE-11765, XE-2893 — none about ref removal stranding a ticket in fixing. Repo: xeprotocol/desk @ ab9df7fdc4f48bee4101060b59b8a2d80e818136.\r\n\r\nSuggested fix: on any PR read, reconcile the ticket's PatchRef rows against the PR's current ref set: when a previously-followed PR no longer references the ticket, run the same close/unmerge follow logic (or at least clear the stale followed/state) instead of early-returning on an empty ref set.","patch_refs":[],"thread":[{"id":15548,"source":"desk","source_ref":"reply:13439","author":"Joseph Denne","team":true,"body":"Thanks. This is the same finding as an earlier report that is not public, which was filed first; the programme pays the\nfirst verifiable submission, so this one closes as a duplicate. If you believe it is a different\nbug, file a new report that links https://bounty.xe.network/XE-13132 and says what differs; it is read like any other.","created_at":"2026-11-20T19:46:06.445147+00:00"}]}