Skip to content

A send right after a view refreshes its page reader is not refused as a changed route - #1612

Merged
trissim merged 1 commit into
mainfrom
fix/send-after-source-swap
Nov 7, 2026
Merged

trissim merged 1 commit into
mainfrom
fix/send-after-source-swap

Conversation

@trissim

@trissim trissim commented Nov 7, 2026

Copy link
Copy Markdown

A DM sent right after the view opens (or refreshes) was refused as "Message route changed; reopen this view" and pasted back into the composer, appended to the user's other draft. ChannelDestination.shown compared the page-reader object; the view replaces that reader on open and on refresh. It now asks whether the view still shows this conversation from this root (ReplaceablePageSource.reads_from; a closed history reads none).

Evidence: test_input_failure_draft 8/8 (3 were failing under the exact pilot settle, OpenHCSDev/textual#257) and test_stale_route_writes (a conversation the view no longer shows is still refused) pass on Textual main and on the settle build.

🤖 Generated with Claude Code

https://claude.ai/code/session_01XbFMSqJMarXn2ZE8iAL7Sd

… a changed route

ChannelDestination.shown asked whether the view still held the very page-reader object
the send was built on. A DM view replaces its reader after it opens (and on every
refresh), so a message sent in that window was refused as "Message route changed;
reopen this view" and dumped back into the composer, appended to whatever the user had
typed since. The question is whether the view still shows this conversation from this
root (IDEN-7: the identity check was wider than that).

- ReplaceablePageSource.reads_from(root): a closed history reads none; WirePageBuffer
  reads from its loader's root.
- ChannelDestination keeps the root and the conversation, drops the reader it held, and
  asks the view's current reader.

Found by the exact pilot settle (OpenHCSDev/textual#257): the old 20 ms sleep let the
reader swap land before the test's send. test_input_failure_draft 8/8 and
test_stale_route_writes pass on Textual main and on the settle build.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01XbFMSqJMarXn2ZE8iAL7Sd
Copilot AI balanced review requested due to automatic review settings November 7, 2026 00:02

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota. Try requesting a review at a lower effort level.

An organization owner can choose the repository organization as the billing source for reviews requested by members with a paid Copilot license. Learn about Copilot code review billing.

@trissim
trissim merged commit 165c5fb into main Nov 7, 2026
3 of 4 checks passed
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.

2 participants