Repository navigation
fix(loop-link): linear frame reads, safe Ctrl-C, no local token to remote hosts - #410
Merged
Merged
Conversation
…fter an interrupted send The receive buffer was bytes, so each chunk copied the full buffer: a 64 MB frame took 40 s. The buffer is now a bytearray. A Ctrl-C in the middle of a frame left half a frame on the socket, and the next send wrote into it. Now any exception during a frame write closes the client, and the next Viewer send opens a new connection. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
For a host that is not loopback, find_viewer now uses only an explicit token or GEOVIEWER_TOKEN. It does not read link.json or the instance files, and it gives a warning because the link is not encrypted. The repr of ViewerAddress does not show the token. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
ToolConnection kept a client that closed itself after a broken send, so the next request failed one time. It now drops a closed client and opens a new one, and connected is False for a closed client. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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.
Fixes three problems found in a repo audit.
_read_exactlyappended to an immutablebytesbuffer, copying it on every chunk. A 32 MB frame took 42 s; it now takes 0.2 s (bytearray buffer).ViewerandToolConnectionsee the closed client and reconnect on the next call. An interrupt while the client waits for a new frame does not close it.Viewer(host="10.x")with notoken=sent the token from~/.geoviewer/link.json. For a host that is not loopback, only an explicit token orGEOVIEWER_TOKENis used now, instance files are not read, and a warning says the link is not encrypted.ViewerAddress.__repr__no longer prints the token.Behaviour change: a remote user who relied on the saved local token now gets a
TokenError, and must passtoken=or setGEOVIEWER_TOKEN. The README says so.Tests:
cd packages/loop_link && pytestgives 817 passed, 66 skipped. Each fix has a regression test that fails without it.🤖 Generated with Claude Code