Repository navigation
fix: invalidate stale video renderer attachments and respect ownership - #1222
xianshijing-lk merged 11 commits into
Conversation
|
This is not a breaking change as the tests say. The API is the same. |
|
This looks like a good fix and refactor. cc @hiroshihorie , @xianshijing-lk |
|
Hello, @hiroshihorie! Can I get a feedback on this? Thanks. |
|
Sorry for the delay, I am reviewing it now. |
xianshijing-lk
left a comment
There was a problem hiding this comment.
Reviewed the lifecycle changes and validated compatibility and cached-renderer ownership with base/head probes. All 10 lifecycle tests pass and current-head analysis is clean. Two correctness comments and one non-blocking documentation request are inline; the default-web rendering finding is source-validated, with the browser execution limitation noted.
xianshijing-lk
left a comment
There was a problem hiding this comment.
Great work!! I like the clean up and fix.
Just some comments to minor problems, could you please address them and fix the CI, then we can land the PR.
Problem
VideoTrackRenderercan finish renderer initialization or listener replacement after its track has changed or its widget has been disposed. A stale async attachment can then install a listener for the wrong track or update a renderer that no longer belongs to that widget State.Reproduction
Delay renderer initialization or disposal of the current track listener. While it is pending, replace the track (including A → B → C) or unmount the widget.
The previous attachment has no validity check after its await.
Fix
autoDisposeRenderer.Related to flutter-webrtc/flutter-webrtc#2227