Skip to content

(fix) shell: handshake defaults width, height#42

Open
mialso wants to merge 2 commits intoholepunchto:mainfrom
mialso:fix/server-shell-connect-error
Open

(fix) shell: handshake defaults width, height#42
mialso wants to merge 2 commits intoholepunchto:mainfrom
mialso:fix/server-shell-connect-error

Conversation

@mialso
Copy link

@mialso mialso commented Jan 23, 2026

Description:

problem: shell mode server fails to accept client connection due to required width & height int by handshakeSpawn protocol

solution: provide default width & height

other options: add protocol defaults

how to repro:

$ npm run test

# shell
    ok 1 - Server firewall allowed
    not ok 2 - server stderr: undefined Error: uint must be positive
    at validateUint (/Users/mialso/projects/hypershell/node_modules/compact-encoding/index.js:1007:11)
    at Object.encode (/Users/mialso/projects/hypershell/node_modules/compact-encoding/index.js:161:5)
    <..>
    at Protomux._oncontrolsession (/Users/mialso/projects/hypershell/node_modules/protomux/index.js:532:21)

      ---
      operator: fail
      source: |
          sp.on('error', (error) => t.fail('server error: ' + error.message))
          sp.stderr.on('data', (data) => t.fail('server stderr: ' + data))
        -----------------------------------^
        
          return sp
      stack: |
        Socket.<anonymous> (./test/helpers/index.js:79:36)
        <..>
        Pipe.onStreamRead (node:internal/stream_base_commons:189:23)
      ...

with the fix:

$ npm run test

<..>
# shell
  ok 1 - Server firewall allowed
  ok 2 - client stdout match
  ok 3 - client closed: 130
  ok 4 - server closed: 130
ok 2 - shell # time = 905.305084ms

<..>

1..4
# tests = 4/4 pass
# asserts = 20/20 pass
# time = 1216.692167ms

# ok

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant