Skip to content

Introduce $kind as a pivot point for uncaught errors #1078

Introduce $kind as a pivot point for uncaught errors

Introduce $kind as a pivot point for uncaught errors #1078

GitHub Actions / Test Report (macos-latest) failed Aug 14, 2024 in 1s

261 passed, 2 failed and 0 skipped

Tests failed

❌ ./test-results.xml

263 tests were completed in 7s with 261 passed, 2 failed and 0 skipped.

Test suite Passed Failed Skipped Time
tests/cleanup.test.ts 14βœ… 553ms
tests/context.test.ts 2βœ… 43ms
tests/disconnects.test.ts 8βœ… 217ms
tests/e2e.test.ts 40βœ… 2❌ 2s
tests/fixtures/observable.test.ts 4βœ… 6ms
tests/handler.test.ts 11βœ… 6ms
tests/negative.test.ts 6βœ… 71ms
tests/serialize.test.ts 4βœ… 4ms
tests/typescript-stress.test.ts 9βœ… 6ms
codec/codec.test.ts 14βœ… 5ms
tracing/tracing.test.ts 4βœ… 37ms
transport/events.test.ts 5βœ… 4ms
transport/impls/ws/ws.test.ts 5βœ… 695ms
transport/message.test.ts 7βœ… 3ms
transport/rateLimit.test.ts 8βœ… 2ms
transport/sessionStateMachine/stateMachine.test.ts 70βœ… 49ms
transport/transforms/messageFraming.test.ts 6βœ… 7ms
transport/transport.test.ts 44βœ… 5s

βœ…Β tests/cleanup.test.ts

βœ… procedures should clean up after themselves ('ws' transport, 'naive' codec) > closing a transport from the client cleans up connection on the server
βœ… procedures should clean up after themselves ('ws' transport, 'naive' codec) > closing a transport from the server cleans up connection on the client
βœ… procedures should clean up after themselves ('ws' transport, 'naive' codec) > rpc
βœ… procedures should clean up after themselves ('ws' transport, 'naive' codec) > stream
βœ… procedures should clean up after themselves ('ws' transport, 'naive' codec) > subscription
βœ… procedures should clean up after themselves ('ws' transport, 'naive' codec) > upload
βœ… procedures should clean up after themselves ('ws' transport, 'naive' codec) > shouldn't send messages across stale sessions
βœ… procedures should clean up after themselves ('ws' transport, 'binary' codec) > closing a transport from the client cleans up connection on the server
βœ… procedures should clean up after themselves ('ws' transport, 'binary' codec) > closing a transport from the server cleans up connection on the client
βœ… procedures should clean up after themselves ('ws' transport, 'binary' codec) > rpc
βœ… procedures should clean up after themselves ('ws' transport, 'binary' codec) > stream
βœ… procedures should clean up after themselves ('ws' transport, 'binary' codec) > subscription
βœ… procedures should clean up after themselves ('ws' transport, 'binary' codec) > upload
βœ… procedures should clean up after themselves ('ws' transport, 'binary' codec) > shouldn't send messages across stale sessions

βœ…Β tests/context.test.ts

βœ… should handle incompatabilities > should pass extended context to procedure
βœ… should handle incompatabilities > should pass extended context to initializeState

βœ…Β tests/disconnects.test.ts

βœ… procedures should handle unexpected disconnects ('ws' transport, 'naive' codec) > rpc
βœ… procedures should handle unexpected disconnects ('ws' transport, 'naive' codec) > stream
βœ… procedures should handle unexpected disconnects ('ws' transport, 'naive' codec) > subscription
βœ… procedures should handle unexpected disconnects ('ws' transport, 'naive' codec) > upload
βœ… procedures should handle unexpected disconnects ('ws' transport, 'binary' codec) > rpc
βœ… procedures should handle unexpected disconnects ('ws' transport, 'binary' codec) > stream
βœ… procedures should handle unexpected disconnects ('ws' transport, 'binary' codec) > subscription
βœ… procedures should handle unexpected disconnects ('ws' transport, 'binary' codec) > upload

❌ tests/e2e.test.ts

βœ… client <-> server integration test ('ws' transport, 'naive' codec) > rpc
βœ… client <-> server integration test ('ws' transport, 'naive' codec) > fallible rpc
βœ… client <-> server integration test ('ws' transport, 'naive' codec) > rpc with binary (uint8array)
βœ… client <-> server integration test ('ws' transport, 'naive' codec) > stream
βœ… client <-> server integration test ('ws' transport, 'naive' codec) > stream empty
βœ… client <-> server integration test ('ws' transport, 'naive' codec) > stream idempotent close
βœ… client <-> server integration test ('ws' transport, 'naive' codec) > stream with init message
❌ client <-> server integration test ('ws' transport, 'naive' codec) > fallible stream
	AssertionError: expected { ok: false, payload: { …(3) } } to strictly equal { ok: false, payload: { …(2) } }
βœ… client <-> server integration test ('ws' transport, 'naive' codec) > subscription
βœ… client <-> server integration test ('ws' transport, 'naive' codec) > subscription idempotent close
βœ… client <-> server integration test ('ws' transport, 'naive' codec) > upload
βœ… client <-> server integration test ('ws' transport, 'naive' codec) > upload empty
βœ… client <-> server integration test ('ws' transport, 'naive' codec) > upload with init message
βœ… client <-> server integration test ('ws' transport, 'naive' codec) > message order is preserved in the face of disconnects
βœ… client <-> server integration test ('ws' transport, 'naive' codec) > concurrent rpcs
βœ… client <-> server integration test ('ws' transport, 'naive' codec) > concurrent streams
βœ… client <-> server integration test ('ws' transport, 'naive' codec) > eagerlyConnect should actually eagerly connect
βœ… client <-> server integration test ('ws' transport, 'naive' codec) > client reconnects even after session grace
βœ… client <-> server integration test ('ws' transport, 'naive' codec) > client doesn't reconnect after session grace if connectOnInvoke is false
βœ… client <-> server integration test ('ws' transport, 'naive' codec) > works with non-object schemas
βœ… client <-> server integration test ('ws' transport, 'naive' codec) > procedure can use metadata
βœ… client <-> server integration test ('ws' transport, 'binary' codec) > rpc
βœ… client <-> server integration test ('ws' transport, 'binary' codec) > fallible rpc
βœ… client <-> server integration test ('ws' transport, 'binary' codec) > rpc with binary (uint8array)
βœ… client <-> server integration test ('ws' transport, 'binary' codec) > stream
βœ… client <-> server integration test ('ws' transport, 'binary' codec) > stream empty
βœ… client <-> server integration test ('ws' transport, 'binary' codec) > stream idempotent close
βœ… client <-> server integration test ('ws' transport, 'binary' codec) > stream with init message
❌ client <-> server integration test ('ws' transport, 'binary' codec) > fallible stream
	AssertionError: expected { ok: false, payload: { …(3) } } to strictly equal { ok: false, payload: { …(2) } }
βœ… client <-> server integration test ('ws' transport, 'binary' codec) > subscription
βœ… client <-> server integration test ('ws' transport, 'binary' codec) > subscription idempotent close
βœ… client <-> server integration test ('ws' transport, 'binary' codec) > upload
βœ… client <-> server integration test ('ws' transport, 'binary' codec) > upload empty
βœ… client <-> server integration test ('ws' transport, 'binary' codec) > upload with init message
βœ… client <-> server integration test ('ws' transport, 'binary' codec) > message order is preserved in the face of disconnects
βœ… client <-> server integration test ('ws' transport, 'binary' codec) > concurrent rpcs
βœ… client <-> server integration test ('ws' transport, 'binary' codec) > concurrent streams
βœ… client <-> server integration test ('ws' transport, 'binary' codec) > eagerlyConnect should actually eagerly connect
βœ… client <-> server integration test ('ws' transport, 'binary' codec) > client reconnects even after session grace
βœ… client <-> server integration test ('ws' transport, 'binary' codec) > client doesn't reconnect after session grace if connectOnInvoke is false
βœ… client <-> server integration test ('ws' transport, 'binary' codec) > works with non-object schemas
βœ… client <-> server integration test ('ws' transport, 'binary' codec) > procedure can use metadata

βœ…Β tests/fixtures/observable.test.ts

βœ… Observable > should set initial value correctly
βœ… Observable > should update value correctly
βœ… Observable > should notify listeners when value changes
βœ… Observable > should unsubscribe from notifications

βœ…Β tests/handler.test.ts

βœ… server-side test > rpc basic
βœ… server-side test > rpc initial state
βœ… server-side test > fallible rpc
βœ… server-side test > stream basic
βœ… server-side test > stream empty
βœ… server-side test > stream with initialization
βœ… server-side test > fallible stream
βœ… server-side test > subscriptions
βœ… server-side test > uploads
βœ… server-side test > uploads empty
βœ… server-side test > uploads with initialization

βœ…Β tests/negative.test.ts

βœ… should handle incompatabilities > throws when sending after close
βœ… should handle incompatabilities > retrying single connection attempt should hit retry limit reached
βœ… should handle incompatabilities > calling connect consecutively should reuse the same connection
βœ… should handle incompatabilities > incorrect client handshake
βœ… should handle incompatabilities > seq number in the future should close connection
βœ… should handle incompatabilities > mismatched protocol version

βœ…Β tests/serialize.test.ts

βœ… serialize server to jsonschema > serialize entire service schema
βœ… serialize service to jsonschema > serialize basic service
βœ… serialize service to jsonschema > serialize service with binary
βœ… serialize service to jsonschema > serialize service with errors

βœ…Β tests/typescript-stress.test.ts

βœ… ensure typescript doesn't give up trying to infer the types for large services > service with many procedures hits typescript limit
βœ… ensure typescript doesn't give up trying to infer the types for large services > server client should support many services with many procedures
βœ… Output<> type > it unwraps rpc outputs correctly
βœ… Output<> type > it unwraps stream outputs correctly
βœ… Output<> type > it unwraps subscription outputs correctly
βœ… Output<> type > it unwraps upload outputs correctly
βœ… ResultUwrap types > it unwraps Ok correctly
βœ… ResultUwrap types > it unwraps Err correctly
βœ… Handshake > custom handhshake types should work

βœ…Β codec/codec.test.ts

βœ… codec -- 'naive' > empty object
βœ… codec -- 'naive' > simple test
βœ… codec -- 'naive' > encodes null properly
βœ… codec -- 'naive' > skips optional fields
βœ… codec -- 'naive' > deeply nested test
βœ… codec -- 'naive' > buffer test
βœ… codec -- 'naive' > invalid json returns null
βœ… codec -- 'binary' > empty object
βœ… codec -- 'binary' > simple test
βœ… codec -- 'binary' > encodes null properly
βœ… codec -- 'binary' > skips optional fields
βœ… codec -- 'binary' > deeply nested test
βœ… codec -- 'binary' > buffer test
βœ… codec -- 'binary' > invalid json returns null

βœ…Β tracing/tracing.test.ts

βœ… Basic tracing tests > createSessionTelemetryInfo
βœ… Basic tracing tests > createHandlerSpan
βœ… Integrated tracing tests ('ws' transport, 'naive' codec) > Traces sessions and connections across network boundary
βœ… Integrated tracing tests ('ws' transport, 'binary' codec) > Traces sessions and connections across network boundary

βœ…Β transport/events.test.ts

βœ… EventDispatcher > notifies all handlers in order they were registered
βœ… EventDispatcher > does not notify removed handlers
βœ… EventDispatcher > does not notify handlers added while notifying another handler
βœ… EventDispatcher > does notify handlers removed while notifying another handler
βœ… EventDispatcher > removes all listeners

βœ…Β transport/impls/ws/ws.test.ts

βœ… sending and receiving across websockets works > basic send/receive
βœ… sending and receiving across websockets works > sending respects to/from fields
βœ… sending and receiving across websockets works > hanging ws connection with no handshake is cleaned up after grace
βœ… sending and receiving across websockets works > ws connection is recreated after unclean disconnect
βœ… sending and receiving across websockets works > ws connection always calls the close callback

βœ…Β transport/message.test.ts

βœ… message helpers > ack
βœ… message helpers > streamOpen
βœ… message helpers > streamClose
βœ… message helpers > handshakeRequestMessage
βœ… message helpers > handshakeResponseMessage
βœ… message helpers > default message has no control flags set
βœ… message helpers > combining control flags works

βœ…Β transport/rateLimit.test.ts

βœ… LeakyBucketRateLimit > should return 0 backoff time for new user
βœ… LeakyBucketRateLimit > should return 0 budget consumed for new user
βœ… LeakyBucketRateLimit > should consume budget correctly
βœ… LeakyBucketRateLimit > keeps growing until startRestoringBudget
βœ… LeakyBucketRateLimit > stops restoring budget when we consume budget again
βœ… LeakyBucketRateLimit > respects maximum backoff time
βœ… LeakyBucketRateLimit > backoff increases
βœ… LeakyBucketRateLimit > reports remaining budget correctly

βœ…Β transport/sessionStateMachine/stateMachine.test.ts

βœ… session state machine > initial state > no connection
βœ… session state machine > initial state > connecting
βœ… session state machine > initial state > handshaking
βœ… session state machine > initial state > connected
βœ… session state machine > initial state > pending identification
βœ… session state machine > state transitions > no connection -> backing off
βœ… session state machine > state transitions > backing off -> connecting
βœ… session state machine > state transitions > connecting -> handshaking
βœ… session state machine > state transitions > handshaking -> connected
βœ… session state machine > state transitions > waiting (no existing session) -> connected
βœ… session state machine > state transitions > waiting (existing session) -> connected
βœ… session state machine > state transitions > backing off -> no connection
βœ… session state machine > state transitions > connecting (conn failed) -> no connection
βœ… session state machine > state transitions > connecting (conn ok) -> no connection
βœ… session state machine > state transitions > handshaking -> no connection
βœ… session state machine > state transitions > connected -> no connection
βœ… session state machine > state transitions preserve buffer, seq, ack > no connection -> backing off
βœ… session state machine > state transitions preserve buffer, seq, ack > backing off -> connecting
βœ… session state machine > state transitions preserve buffer, seq, ack > connecting -> handshaking
βœ… session state machine > state transitions preserve buffer, seq, ack > handshaking -> connected
βœ… session state machine > state transitions preserve buffer, seq, ack > backing off -> no connection
βœ… session state machine > state transitions preserve buffer, seq, ack > connecting -> no connection
βœ… session state machine > state transitions preserve buffer, seq, ack > handshaking -> no connection
βœ… session state machine > state transitions preserve buffer, seq, ack > connected -> no connection
βœ… session state machine > state transitions deal with session grace period appropriately > no connection -> backing off: partially consumed grace period
βœ… session state machine > state transitions deal with session grace period appropriately > no connection -> backing off -> connecting: partially consumed grace period
βœ… session state machine > state transitions deal with session grace period appropriately > no connection -> backing off -> connecting -> handshaking: partially consumed grace period
βœ… session state machine > state transitions deal with session grace period appropriately > no connection -> backing off -> connecting -> handshaking -> connected: partially consumed grace period
βœ… session state machine > state transitions deal with session grace period appropriately > backing off -> no connection: partially consumed grace period
βœ… session state machine > state transitions deal with session grace period appropriately > connecting -> no connection: partially consumed grace period
βœ… session state machine > state transitions deal with session grace period appropriately > handshaking -> no connection: partially consumed grace period
βœ… session state machine > state transitions deal with session grace period appropriately > handshaking -> connected: connected should clear grace timer
βœ… session state machine > stale handles post-transition > no connection -> backing off: stale handle
βœ… session state machine > stale handles post-transition > backing off -> connecting: stale handle
βœ… session state machine > stale handles post-transition > connecting -> handshaking: stale handle
βœ… session state machine > stale handles post-transition > handshaking -> connected: stale handle
βœ… session state machine > stale handles post-transition > waiting -> connected: stale handle
βœ… session state machine > stale handles post-transition > backing off -> no connection: stale handle
βœ… session state machine > stale handles post-transition > connecting -> no connection: stale handle
βœ… session state machine > stale handles post-transition > handshaking -> no connection: stale handle
βœ… session state machine > stale handles post-transition > connected -> no connection: stale handle
βœ… session state machine > close cleanup > no connection
βœ… session state machine > close cleanup > backing off
βœ… session state machine > close cleanup > connecting
βœ… session state machine > close cleanup > connecting finish after close
βœ… session state machine > close cleanup > handshaking
βœ… session state machine > close cleanup > connected
βœ… session state machine > close cleanup > pending identification
βœ… session state machine > event listeners > no connection event listeners: onSessionGracePeriodElapsed
βœ… session state machine > event listeners > backing off event listeners: onBackoffFinished
βœ… session state machine > event listeners > backing off event listeners: onSessionGracePeriodElapsed
βœ… session state machine > event listeners > connecting event listeners: connectionEstablished
βœ… session state machine > event listeners > connecting event listeners: connectionFailed
βœ… session state machine > event listeners > connecting event listeners: connectionTimeout
βœ… session state machine > event listeners > connecting event listeners: sessionGracePeriodElapsed
βœ… session state machine > event listeners > handshaking event listeners: connectionErrored
βœ… session state machine > event listeners > handshaking event listeners: connectionClosed
βœ… session state machine > event listeners > handshaking event listeners: onHandshakeData
βœ… session state machine > event listeners > handshaking event listeners: handshakeTimeout
βœ… session state machine > event listeners > handshaking event listeners: sessionGracePeriodElapsed
βœ… session state machine > event listeners > pending identification event listeners: connectionErrored
βœ… session state machine > event listeners > pending identification event listeners: connectionClosed
βœ… session state machine > event listeners > pending identification event listeners: onHandshakeData
βœ… session state machine > event listeners > pending identification event listeners: handshakeTimeout
βœ… session state machine > event listeners > connected event listeners: connectionErrored
βœ… session state machine > event listeners > connected event listeners: connectionClosed
βœ… session state machine > event listeners > connected event listeners: onMessageData
βœ… session state machine > heartbeats > active heartbeating works and is cleared on state transition
βœ… session state machine > heartbeats > passive heartbeating echoes back acks
βœ… session state machine > heartbeats > does not dispatch acks

βœ…Β transport/transforms/messageFraming.test.ts

βœ… MessageFramer > basic transform
βœ… MessageFramer > handles partial messages across chunks
βœ… MessageFramer > multiple messages in a single chunk
βœ… MessageFramer > max buffer size exceeded
βœ… MessageFramer > incomplete message at stream end
βœ… MessageFramer > consistent byte length calculation with emojis and unicode

βœ…Β transport/transport.test.ts

βœ… transport connection behaviour tests ('ws' transport, 'naive' codec) > connection is recreated after clean client disconnect
βœ… transport connection behaviour tests ('ws' transport, 'naive' codec) > misbehaving clients get their sessions recreated after reconnect
βœ… transport connection behaviour tests ('ws' transport, 'naive' codec) > idle transport cleans up nicely
βœ… transport connection behaviour tests ('ws' transport, 'naive' codec) > idle transport stays alive
βœ… transport connection behaviour tests ('ws' transport, 'naive' codec) > heartbeats should not interrupt normal operation
βœ… transport connection behaviour tests ('ws' transport, 'naive' codec) > sending right after session event should not cause invalid handshake
βœ… transport connection behaviour tests ('ws' transport, 'naive' codec) > seq numbers should be persisted across transparent reconnects
βœ… transport connection behaviour tests ('ws' transport, 'naive' codec) > both client and server transport get connect/disconnect notifs
βœ… transport connection behaviour tests ('ws' transport, 'naive' codec) > transport connection is not recreated after destroy
βœ… transport connection behaviour tests ('ws' transport, 'naive' codec) > multiple connections works
βœ… transport connection behaviour tests ('ws' transport, 'binary' codec) > connection is recreated after clean client disconnect
βœ… transport connection behaviour tests ('ws' transport, 'binary' codec) > misbehaving clients get their sessions recreated after reconnect
βœ… transport connection behaviour tests ('ws' transport, 'binary' codec) > idle transport cleans up nicely
βœ… transport connection behaviour tests ('ws' transport, 'binary' codec) > idle transport stays alive
βœ… transport connection behaviour tests ('ws' transport, 'binary' codec) > heartbeats should not interrupt normal operation
βœ… transport connection behaviour tests ('ws' transport, 'binary' codec) > sending right after session event should not cause invalid handshake
βœ… transport connection behaviour tests ('ws' transport, 'binary' codec) > seq numbers should be persisted across transparent reconnects
βœ… transport connection behaviour tests ('ws' transport, 'binary' codec) > both client and server transport get connect/disconnect notifs
βœ… transport connection behaviour tests ('ws' transport, 'binary' codec) > transport connection is not recreated after destroy
βœ… transport connection behaviour tests ('ws' transport, 'binary' codec) > multiple connections works
βœ… transport disabling transparent reconnect ('ws' transport, 'naive' codec) > reconnecting with grace period of 0 should result in hard reconnect
βœ… transport disabling transparent reconnect ('ws' transport, 'binary' codec) > reconnecting with grace period of 0 should result in hard reconnect
βœ… transport handshake grace period tests ('ws' transport, 'naive' codec) > handshake grace period of 0 should lead to closed connections
βœ… transport handshake grace period tests ('ws' transport, 'binary' codec) > handshake grace period of 0 should lead to closed connections
βœ… transport connection edge cases ('ws' transport, 'naive' codec) > reconnecting before grace period ends should leave session intact
βœ… transport connection edge cases ('ws' transport, 'naive' codec) > session grace elapses during long reconnect loop
βœ… transport connection edge cases ('ws' transport, 'naive' codec) > messages should not be resent when the client loses all state and reconnects to the server
βœ… transport connection edge cases ('ws' transport, 'naive' codec) > messages should not be resent when client reconnects to a different instance of the server
βœ… transport connection edge cases ('ws' transport, 'naive' codec) > recovers from phantom disconnects
βœ… transport connection edge cases ('ws' transport, 'binary' codec) > reconnecting before grace period ends should leave session intact
βœ… transport connection edge cases ('ws' transport, 'binary' codec) > session grace elapses during long reconnect loop
βœ… transport connection edge cases ('ws' transport, 'binary' codec) > messages should not be resent when the client loses all state and reconnects to the server
βœ… transport connection edge cases ('ws' transport, 'binary' codec) > messages should not be resent when client reconnects to a different instance of the server
βœ… transport connection edge cases ('ws' transport, 'binary' codec) > recovers from phantom disconnects
βœ… transport handshake tests ('ws' transport, 'naive' codec) > handshakes and stores parsed metadata in session
βœ… transport handshake tests ('ws' transport, 'naive' codec) > client checks request schema on construction
βœ… transport handshake tests ('ws' transport, 'naive' codec) > server checks request schema on receive
βœ… transport handshake tests ('ws' transport, 'naive' codec) > server gets previous parsed metadata on reconnect
βœ… transport handshake tests ('ws' transport, 'naive' codec) > parse can reject connection
βœ… transport handshake tests ('ws' transport, 'binary' codec) > handshakes and stores parsed metadata in session
βœ… transport handshake tests ('ws' transport, 'binary' codec) > client checks request schema on construction
βœ… transport handshake tests ('ws' transport, 'binary' codec) > server checks request schema on receive
βœ… transport handshake tests ('ws' transport, 'binary' codec) > server gets previous parsed metadata on reconnect
βœ… transport handshake tests ('ws' transport, 'binary' codec) > parse can reject connection

Annotations

Check failure on line 0 in ./test-results.xml

See this annotation in the file changed.

@github-actions github-actions / Test Report (macos-latest)

__tests__/e2e.test.ts β–Ί client <-> server integration test ('ws' transport, 'naive' codec) > fallible stream

Failed test found in:
  ./test-results.xml
Error:
  AssertionError: expected { ok: false, payload: { …(3) } } to strictly equal { ok: false, payload: { …(2) } }
Raw output
AssertionError: expected { ok: false, payload: { …(3) } } to strictly equal { ok: false, payload: { …(2) } }
 ❯ __tests__/e2e.test.ts:333:23
            

Check failure on line 0 in ./test-results.xml

See this annotation in the file changed.

@github-actions github-actions / Test Report (macos-latest)

__tests__/e2e.test.ts β–Ί client <-> server integration test ('ws' transport, 'binary' codec) > fallible stream

Failed test found in:
  ./test-results.xml
Error:
  AssertionError: expected { ok: false, payload: { …(3) } } to strictly equal { ok: false, payload: { …(2) } }
Raw output
AssertionError: expected { ok: false, payload: { …(3) } } to strictly equal { ok: false, payload: { …(2) } }
 ❯ __tests__/e2e.test.ts:333:23