microsoft / microsoft/dev-tunnels
`RefreshPorts` code path doesn't really make sense
Nobody has claimed this yet.
- Dominant language
- C#
- Stars
- 508
- Forks
- 52
- Avg merge
- 20h 6m
- Merged PRs (30d)
- 7
Description
Description
Someone shared this error log for gh cs ssh (used to connect to GitHub codespaces over ssh):
kex_exchange_identification: read: Connection reset by peer
Connection reset by 127.0.0.1 port 65225
tunnel closed: error forwarding port: refresh ports failed: failed to refresh ports: %!w(<nil>)
Looking at the code where this error is returned, there doesn't appear to be any case in which the error will be non-nil:
I have no opinion on what the message should say. Happy to open a PR with your recommendation.
Separately, as a minor nit reading this code, it seems like it would be better for the final return on this method to be return nil, since again, no other value is possible.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Read go/tunnels/client.go around lines 210-219 and trace the RefreshPorts return path that produces the reported gh cs ssh error. Check how the error is wrapped and what the final return should represent; done means the nil-error case no longer formats as an error and the method's return behavior matches the reachable code paths.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- go
- Domain
- networking
- Issue type
- Bug
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 48/100