feat(data-connect): introduce error handling for streaming#9726
feat(data-connect): introduce error handling for streaming#9726stephenarosaj merged 35 commits intopasta/mainfrom
Conversation
… promise rejection checking
|
There was a problem hiding this comment.
Code Review
This pull request introduces robust error handling for streaming transport responses. The changes ensure that errors in queries and mutations reject the corresponding promises and that state is cleaned up correctly. For subscriptions, errors are now routed to the subscription hook without terminating the subscription, which is the correct behavior. The implementation is solid, and the new unit tests provide excellent coverage for the new error handling logic. I have one suggestion to improve maintainability by reducing code duplication.
|
/gemini review |
There was a problem hiding this comment.
Code Review
This pull request introduces comprehensive error handling for the streaming transport layer. The changes are well-structured, with significant refactoring to improve code clarity by centralizing request tracking and cleanup logic. Promises for queries and mutations are now correctly rejected on errors, while subscriptions properly receive error payloads without terminating. The addition of thorough unit tests covering all new error paths is also a great improvement. I have one suggestion to remove a redundant line of code to further centralize the cleanup logic.
Description
✨ This PR introduces error handling for the streaming transport layer. It ensures that local and server-side errors are handled correctly, mirroring the existing behavior of the REST architecture while supporting the unique lifecycles required for subscriptions.
Changes
DataConnectOperationErrorwhen an error payload is received from the server for queries or mutations.send*Message()to gracefully reject the associated execution promise if the local message transmission fails.Testing
DataConnectOperationErrorupon receiving error payloads from the server.