Fix peer connection previous-connect analytics scope - #1763
Conversation
PR checklist ✅All required conditions are satisfied:
🎉 Great job! This PR is ready for review. |
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (5)
WalkthroughPeer connection analytics now tracks publisher and subscriber connection history separately. The role-specific state is passed to event reporting, which no longer stores its own connection-history map. Tests cover initial connections, failures, connected states, and publisher reconnects. ChangesPeer connection history tracking
Estimated code review effort: 3 (Moderate) | ~20 minutes Sequence Diagram(s)sequenceDiagram
participant PeerConnectionAnalytics
participant StateHolder
participant ClientEventReporter
PeerConnectionAnalytics->>StateHolder: update role when connection reaches CONNECTED
PeerConnectionAnalytics->>StateHolder: read role-specific ever-connected state
PeerConnectionAnalytics->>ClientEventReporter: report state with wasPrevConnected
ClientEventReporter->>ClientEventReporter: handle connecting state
Suggested reviewers: Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
SDK Size Comparison 📏
|
|




Goal
Closes #AND-1368
Ensure wasPreviouslyConnected is reported only for the relevant peer connection role within the current call analytics lifecycle, instead of leaking cached state from previous calls.
Implementation
Moved peer connection “ever connected” tracking out of the client-level reporter state and into
PeerConnectionAnalyticsStateHolder, so the value is scoped to peer connection analytics for the current call.PeerConnectionAnalyticsnow updates publisher/subscriber connected state when aCONNECTEDevent is observed and passes the role-specificwasPrevConnectedvalue intoClientEventReporter.🎨 UI Changes
None
Testing
wasPrevConnected = falsewasPrevConnected = truewasPrevConnectedinput instead of relying on cached client-level stateSummary by CodeRabbit
Analytics
Tests