feat(fdc): Streaming implementation for data connect#18174
feat(fdc): Streaming implementation for data connect#18174aashishpatil-g wants to merge 13 commits intomainfrom
Conversation
* Initial Commit * Fix formatting and analyzer warnings * Fix tests and licenses * Denver feedback: var initialization best practice * sorted keys for id generation * Fix analyze info messages
* Handle disconnects and reconnects * Address gemini review comments * Reconnection logic * Fixes to reconnect on startup * Fix to decode binary data from server * Handle gemini feedback * Update rest_transport mocks with new windows provider sig
* debug logging and hardering * Hardening: ensure only one multicast stream controller is created in a ref * Handle cancellations * Formatting fix
Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for GitHub and other Google products, sign up here. |
packages/firebase_data_connect/firebase_data_connect/lib/src/common/dataconnect_error.dart
Outdated
Show resolved
Hide resolved
packages/firebase_data_connect/firebase_data_connect/lib/src/core/ref.dart
Outdated
Show resolved
Hide resolved
packages/firebase_data_connect/firebase_data_connect/lib/src/core/ref.dart
Show resolved
Hide resolved
|
/gemini review |
There was a problem hiding this comment.
Code Review
This pull request implements real-time streaming support for the Firebase Data Connect SDK by introducing a WebSocket-based transport layer and a new streaming protocol. It transitions the library from gRPC to a hybrid REST and WebSocket approach, managed by a routing transport. Feedback highlights critical issues regarding resource management, specifically the potential for leaked WebSocket connections and memory leaks from uncancelled subscriptions. Other recommendations include optimizing the expensive operation ID generation, ensuring consistency by making variables final, and adhering to style guidelines regarding function length and the use of the non-null assertion operator.
packages/firebase_data_connect/firebase_data_connect/lib/src/firebase_data_connect.dart
Show resolved
Hide resolved
packages/firebase_data_connect/firebase_data_connect/lib/src/network/websocket_transport.dart
Show resolved
Hide resolved
packages/firebase_data_connect/firebase_data_connect/lib/src/core/ref.dart
Outdated
Show resolved
Hide resolved
packages/firebase_data_connect/firebase_data_connect/lib/src/core/ref.dart
Show resolved
Hide resolved
packages/firebase_data_connect/firebase_data_connect/lib/src/core/ref.dart
Show resolved
Hide resolved
packages/firebase_data_connect/firebase_data_connect/lib/src/network/websocket_transport.dart
Show resolved
Hide resolved
packages/firebase_data_connect/firebase_data_connect/lib/src/network/websocket_transport.dart
Outdated
Show resolved
Hide resolved
packages/firebase_data_connect/firebase_data_connect/lib/src/network/websocket_transport.dart
Show resolved
Hide resolved
packages/firebase_data_connect/firebase_data_connect/lib/src/network/stream_protocol.dart
Show resolved
Hide resolved
packages/firebase_data_connect/firebase_data_connect/lib/src/network/stream_protocol.dart
Show resolved
Hide resolved
packages/firebase_data_connect/firebase_data_connect/lib/src/network/stream_protocol.dart
Show resolved
Hide resolved
packages/firebase_data_connect/firebase_data_connect/lib/src/network/transport_library.dart
Outdated
Show resolved
Hide resolved
packages/firebase_data_connect/firebase_data_connect/lib/src/network/transport_stub.dart
Show resolved
Hide resolved
packages/firebase_data_connect/firebase_data_connect/lib/src/network/transport_stub.dart
Outdated
Show resolved
Hide resolved
packages/firebase_data_connect/firebase_data_connect/lib/src/firebase_data_connect.dart
Show resolved
Hide resolved
This affects reconnects. Taking tech debt instead.
initialized as a lazy var that is used everywhere instead of computing always
Implements streaming support in Firebase Data Connect for subscribe().