Skip to content

fix(threading): the image path skipped the thread, and a comment was false - #1153

Merged
lilyshen0722 merged 1 commit into
mainfrom
fix/threading-composer-followups
Aug 23, 2026
Merged

lilyshen0722 merged 1 commit into
mainfrom
fix/threading-composer-followups

Conversation

@lilyshen0722

Copy link
Copy Markdown
Contributor

@sprint-review's three non-blocking follow-ups on #1150 (57467). All three were real; one was worse than reported.

1. The image path sent no thread target

The text send passed the root; the upload send didn't. So posting a picture while the composer read "Replying in thread" put it in the channel instead. Two send sites, one updated — and there was no test on the upload path at all, which is why it was missed.

Fixed, with a test that fails when the fix is reverted (probed both ways).

2. "The resolver 400s a message carrying both" is false — in four places, not three

resolveThreadRoot rejects the pair only when they disagree (thread_root_mismatch). A reply edge and an explicit root pointing at the same thread are accepted happily.

That inverts what the composer's exclusivity is for. It isn't a client nicety in front of a backend that would refuse the pair — it's the only thing enforcing it. An in-thread post must carry no addressing edge because a reply edge pings the root's author (@ux-lead 56879), and if the client stops keeping them exclusive, nothing downstream notices.

All four comments now say that, and the test comment says the client is the sole guard rather than implying the server is a backstop.

I counted the copies rather than trusting the number in the report — four, not three. Same lesson as this morning, pointed the other way for once.

3. buildThreadView was O(n²) and unmemoized

Two problems, both fixed. Memoized on (messages, byRoot) so a composer keystroke no longer re-folds the whole list, and the messages.some(...) inside the loop is now a Set built once — fine at 20 messages, not at 2,000.


77 suites, 416 tests green — the whole frontend suite, no path filter. That habit is three days old and one PR old; running a subset is what put two of today's failures into CI.

🤖 Generated with Claude Code

…false

@sprint-review's three follow-ups on #1150, all real.

1. THE IMAGE PATH SENT NO THREAD TARGET. The text send passed the root and
   the upload send did not, so posting a picture while the composer read
   "Replying in thread" put it in the channel instead. Two send sites, one
   updated — and there was no test on the upload path at all, which is why it
   was missed. Fixed, with a test that fails when the fix is reverted (probed).

2. "The resolver 400s a message carrying both" IS FALSE, and it was in FOUR
   places, not the three reported. resolveThreadRoot rejects the pair only
   when they DISAGREE (thread_root_mismatch); a reply edge and an explicit
   root that point at the same thread are accepted happily.

   That inverts what the composer's exclusivity is for. It is not a client
   nicety in front of a backend that would refuse the pair — it is the only
   thing enforcing it. An in-thread post must carry no addressing edge
   because a reply edge pings the root's author (@ux-lead 56879), and if the
   client stops keeping them exclusive, nothing downstream notices. All four
   comments now say that, and the test comment says the client is the only
   guard rather than implying the server is a backstop.

3. buildThreadView was O(n²) AND unmemoized, which are two problems.
   Memoized on (messages, byRoot) so a keystroke no longer re-folds the list,
   and the `messages.some(...)` inside the loop is now a Set built once —
   fine at 20 messages, not at 2,000.

Counted the false claim rather than trusting the number in the report: four
copies. Same lesson as this morning, pointed the other way for once.

77 suites, 416 tests green — the whole frontend suite, not a subset.

Co-Authored-By: Claude Opus 5 <[email protected]>
@lilyshen0722
lilyshen0722 merged commit 7121ed2 into main Aug 23, 2026
11 checks passed
@lilyshen0722
lilyshen0722 deleted the fix/threading-composer-followups branch August 23, 2026 00:31
lilyshen0722 added a commit that referenced this pull request Aug 23, 2026
…r; the resolver refuses only disagreement (#1154)

* docs(design): the composer's target exclusivity is the enforcing layer — the resolver refuses only disagreement

#1153 found resolveThreadRoot rejects a reply edge + explicit root only when
they disagree; an agreeing pair passes. So 'an in-thread post addresses
nobody' is enforced by the composer's one-target-two-kinds rule, on every
send path (text and upload), each pinned — not by a server refusal.

Co-Authored-By: Claude Fable 5 <[email protected]>

* docs(design): a send consumes the composer target on every path — text and image clear alike

Co-Authored-By: Claude Fable 5 <[email protected]>

* docs(design): the rail is the context — no quote block for a reply whose quoted message is the visible thread parent (Sam, 57487)

Co-Authored-By: Claude Fable 5 <[email protected]>

* docs(design): quote-and-thread independence is full both ways — any quote renders; only the root's redundant quote under its own rail is hidden (Sam, 57491)

Co-Authored-By: Claude Fable 5 <[email protected]>

* docs(design): mention-follows-you is agent-only today; a mentioned human who never posts follows nothing (pod-architect, 57535)

Co-Authored-By: Claude Fable 5 <[email protected]>

* docs(design): a delivered @-mention follows the mentioned participant, agent or human — #1157 landed, the bullet widens back

Co-Authored-By: Claude Fable 5 <[email protected]>

---------

Co-authored-by: Claude Fable 5 <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant