feat(data-connect): Integrate Query Layer with Streaming#9793
feat(data-connect): Integrate Query Layer with Streaming#9793stephenarosaj merged 40 commits intopasta/mainfrom
Conversation
|
There was a problem hiding this comment.
Code Review
This pull request integrates streaming capabilities into the DataConnect query layer, enabling data updates through a subscription model. Key changes include the implementation of subscription lifecycle management in QueryManager, the addition of a notification hook to handle incoming transport data and update the cache, and adjustments to WebSocket close codes for Node.js compatibility. Review feedback highlights a potential race condition where subscriptions might miss immediate notifications, an issue with JSON.stringify omitting non-enumerable Error properties, and a suggestion to use custom WebSocket close codes (3000-4999) for better failure diagnostics.
|
/gemini review |
There was a problem hiding this comment.
Code Review
This pull request integrates streaming capabilities into the DataConnect query layer, enabling data updates through subscriptions. Key changes include updating QueryManager to manage transport-level subscriptions, introducing specialized URL builders for REST and WebSocket endpoints, and refining WebSocket closure logic for better environment compatibility. Feedback highlights opportunities to refactor duplicated key generation logic, remove redundant cache updates, and ensure that error stringification and WebSocket close reasons adhere to technical constraints.
…perations and eliminate race conditions- ensure connection
Description
✨ This PR integrates
QueryManagerwith the streaming transport to support query subscriptions and handle stream notifications, and allow for executions over the stream.Changes
invokeSubscribeandinvokeUnsubscribecalls, and pass notification hook to the Transport layer which handles updating cache and notifying subscribers in data and error return cases.send*Message()functions to more clearly orchestrate order of operations and eliminate race conditions - ensure connection, then prepare message, then send.Other Changes:
GRACEFUL_CLOSEto avoid Node environment errors.invokeSubscribe()methods in others (sincesubscribe()now has increased functionality and invokes network operations), as well as adding in new required members after refactoring.Testing