fix(android): E2EE review follow-ups - #73
Conversation
getTrackById() looked up remote tracks by enumerating pc.getReceivers() and returning receiver.track(). On Android, PeerConnection.getReceivers() disposes every RtpReceiver wrapper from its previous call before creating new ones, and disposing a receiver disposes its cached VideoTrack, which detaches all of its sinks. So any later getReceivers() call on the same PeerConnection (E2EE decrypt() attaching to another receiver, getStats on a receiver, or getTrackById() itself) silently stopped frames reaching a recorder attached to the returned track. Return the stable wrapper kept in PeerConnectionObserver.remoteTracks instead. It is the same object RTCView renders through and getTrack() already reads, and getReceivers() never touches it.
An exception while converting an encryptionManagerEvent on the crypto worker, or while emitting it on the executor, now gets logged and the event dropped instead of propagating. Keys and transforms are unaffected.
The comments in Android invalidate() and iOS dealloc read as if disposing the E2EE managers before the peer connections were needed for correctness. They are disposed there because JS is gone and nothing else can release them; the order does not matter for safety.
Note in the encrypt() JSDoc that the transform should be attached before the sender has a track or is negotiated to send, since frames sent before attachment go out unencrypted.
|
Navigate logical layers of code changes, visualize relationships, and explore their blast radius. No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Advanced Run ID: 📒 Files selected for processing (4)
Included review availability: This review used your included allowance. Your plan provides up to 1 included review per hour; 0 remain after this review. 📝 WalkthroughWalkthroughAndroid event delivery now catches runtime failures, and ChangesNative module updates
Priority: ➖ Normal Estimated code review effort: 2 (Simple) | ~10 minutes Change: Bug fix Suggested reviewers: Merge Risk: ⚪ Minimal · up to No merge-blocking issue is established. Complete the normal Android and iOS build checks before merging. Security Architecture ReviewSecurity architecture risk: 🔵 Low · up to The changes appear to preserve encryption behavior while fixing a track-lifetime problem. No new security vulnerability was established, but the consequences of a dropped encryption notification are not fully documented. Retained concerns Security review detailsSecurity Blast Radius
Trust Boundaries and Controls
Resilience and Maintainability Implications
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
Full details: Docstring CoverageExplanation Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 3 functions across 3 files. (1 skipped: 1 unsupported.)
✨ Finishing Touches 💡 1📝 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 |
## [145.4.1](v145.4.0...v145.4.1) (2026-09-28) ### Bug Fixes * **android:** E2EE review follow-ups ([#73](#73)) ([bb6a629](bb6a629))
|
🎉 This PR is included in version 145.4.1 🎉 The release is available on: Your semantic-release bot 📦🚀 |
Follow-ups to the review of #68.
getTrackById()now returns the track wrapper the observer keeps. Before, it usedpc.getReceivers(), which disposes the wrappers from its previous call and detaches their sinks. That broke the recorder when E2EEdecrypt()orreceiver.getStats()ran on the same peer connection. Android only.encrypt()docs say to attach before the sender has a track or is negotiated to send.Tested on dogfood: loopback recording keeps video while receivers are enumerated mid-recording, and E2EE meeting join, leave, rejoin, wrong-key, and bundle reload all pass on both platforms.
🎫 Ticket: https://linear.app/stream/issue/RN-434
Summary by CodeRabbit