Repository navigation
♻️ Trim the public-ports protocol and share one fake share socket - #34
Merged
Merged
Conversation
Drop the share request's access field, the unread since and revision fields and the session request's content type; ws-server ignores them. The response keeps access, which port list prints. List, Tab and Clear decode through one helper, and the share, port and serve tests use one fake share socket from testutil.
json.Unmarshal fills the fields it reads before a type error, so List, Tab and Clear could hand back a half-filled value with the error, and port list no longer resets it. decode now returns the zero value.
Any other method or path gets the not-found answer an old ws-server gives, so a client calling the wrong route fails its test.
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.
Story 6.28: the ws-cli side of hardening public ports before their first release.
accessor acontent-typeheader; ws-server never read either.sinceandListing.Revisionare gone from the decoded types.List,TabandClearshare onedecodehelper, which returns the zero value on a JSON error.port listbuilds its rows through oneadd().internals/testutil(POST/ports/shareonly) replaces the per-package fakes.Wire-compatible both ways with older and newer ws-server.
Verified locally:
go test ./...,-raceon the port and serve packages, prek.