gqty-dev / gqty

The No-GraphQL Client for TypeScript
https://gqty.dev
MIT License
934 stars 26 forks source link

fix(gqty): onSubscribe for connected WebSockets #2033

Closed vicary closed 2 weeks ago

vicary commented 3 weeks ago

Summary

The onSubscribe option on the core API subscribe() is firing only on the first connection_ack, callbacks on subsequent subscriptions using the same WebSocket connection are unintentionally skipped.

Expected Result

  1. When a subscription triggers a lazy connection, onSubscribe is called when we receive connection_ack.
  2. When a subscription happens on an existing connection, onSubscribe is called immediately.
  3. When a subscription happens during a reconnection attempt, onSubscribe is called when the connection is established.
github-actions[bot] commented 3 weeks ago

🚀 Snapshot Release (canary)

The latest changes of this PR are available as canary on npm (based on the declared changesets): Package Version Info
@gqty/cli 4.2.1-canary-20241110205308.6f5123252e0573c9ed6a8616c6d0a9d99f18707b npm ↗︎ unpkg ↗︎
gqty 3.2.2-canary-20241110205308.6f5123252e0573c9ed6a8616c6d0a9d99f18707b npm ↗︎ unpkg ↗︎
@gqty/logger 3.0.5-canary-20241110205308.6f5123252e0573c9ed6a8616c6d0a9d99f18707b npm ↗︎ unpkg ↗︎
@gqty/react 3.0.5-canary-20241110205308.6f5123252e0573c9ed6a8616c6d0a9d99f18707b npm ↗︎ unpkg ↗︎
@gqty/solid 0.2.2-canary-20241110205308.6f5123252e0573c9ed6a8616c6d0a9d99f18707b npm ↗︎ unpkg ↗︎