Repository navigation
Inbox: a stale tab's 409 says Inbox, not review - #1773
Merged
Merged
Conversation
The Inbox's stale-tab refusal reused serverSessionMismatchBody(), whose error reads "This review was replaced by a newer Plannotator session…", and the Inbox window shows a refusal's error as it is. The body now takes an optional message; every Inbox route passes INBOX_SERVER_SESSION_MISMATCH_ERROR. Plan, annotate and code review (Bun and Pi) call it without one and answer byte for byte as before.
1 task
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Found in the 0.28.8 release smoke: an Inbox tab left open on an older Inbox told the person "This review was replaced by a newer Plannotator session on the same address. Reload the page to see what is open now; nothing was submitted." The Inbox holds no review, and what was refused (a pick, a Send, a setting) was saved, not submitted.
Root cause
The text did not come from
ServerSessionReplacedBanner. The Inbox window never mounts that banner. Its own error lines show a refusal'serrorfield as the server sent it (packages/inbox/api.ts,readJson). Every Inbox route answered a stale nonce with the sharedserverSessionMismatchBody(), and that function always used the review wordingSERVER_SESSION_MISMATCH_ERROR.Fix
In
packages/core/server-session.ts:serverSessionMismatchBody(error = SERVER_SESSION_MISMATCH_ERROR)now takes an optional message.INBOX_SERVER_SESSION_MISMATCH_ERROR: "This Inbox page is out of date: a newer Plannotator Inbox runs on the same address. Reload the page to see it; nothing was saved."Every Inbox stale-tab site passes the Inbox wording:
inbox.ts(seen, picks/reply/resolve, settings, restart, decisions),inbox-attachments.ts,inbox-guides.tsandinbox-sessions.ts. The code is stillsession_mismatch.Plan, annotate and code review, on both Bun and the vendored Pi copy, call the function with no argument. Their bodies are byte for byte unchanged, and so is
ServerSessionReplacedBanner.Test
packages/server/inbox.test.ts, the stale-tab test: one route from each Inbox route module, plus settings, answers 409session_mismatchwith the Inbox wording and never the word "review". It fails on main, which returns the review sentence.🤖 Generated with Claude Code