Repository navigation
Stop compounding username rename suffixes with a per-tab handshake - #14
Merged
Merged
Conversation
The duplicated-tab rename could loop: the renamed client's reconnect raced its own stale socket, the server saw a 'live' session on the name and renamed again, and each adopted suffix was persisted - producing usernames like name-nsa-rwz-5xb-... 20 suffixes deep. - The client now sends a per-page-load tab id (in-memory only, so a duplicated tab gets a fresh one while a reconnect keeps its own) - Same username + same tab id = the same tab reconnecting: the server keeps the name and drops the stale session; different tab id = a genuine duplicate, renamed once - Rename base capped at 20 chars so names are bounded regardless - Header username gains ellipsis overflow protection Verified at the protocol level: same-tab reconnect keeps the name and closes the stale socket, a different tab renames exactly once, and an already-runaway 40-char name is trimmed to 24 on rename. Full e2e suite 11/11. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Rs2vdovnTd4RjchV1b5dnF
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
Fixes the runaway usernames like
self-appointed-p-nsa-rwz-5xb-7n8-...(20+ stacked suffixes).Root cause: the duplicated-tab protection renamed any connection whose username was held by a live session — but when a renamed client reconnected under its new name, its own stale socket could still register as live for a moment. The server renamed again, the client adopted and persisted again, looping one suffix per cycle.
Fix (implemented by Sonnet agents, reviewed and validated):
Testing
racer→racer) and the server closes the stale session; a different tab renames exactly once (racer-3ym); a 40-char runaway name is trimmed to 24 on rename.npm run buildandmvn clean packageclean.🤖 Generated with Claude Code
https://claude.ai/code/session_01Rs2vdovnTd4RjchV1b5dnF
Generated by Claude Code