Skip to content

Conversation

hiroshihorie
Copy link
Member

The constructors of LocalTrackPublication and RemoteTrackPublication relied on setting the track property during initialization. However, because updateTrack() was an un-awaited async method, the track property was null immediately after construction, which caused confusion.

Copy link

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR fixes an initialization issue where the track property was null immediately after construction of LocalTrackPublication and RemoteTrackPublication objects due to un-awaited async updateTrack() calls.

  • Modified the base TrackPublication constructor to accept and directly initialize the track parameter
  • Extracted track listener attachment logic into a reusable private method
  • Updated both LocalTrackPublication and RemoteTrackPublication to pass the track parameter to the parent constructor instead of calling updateTrack()

Reviewed Changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.

File Description
lib/src/publication/track_publication.dart Added track parameter to constructor and extracted listener attachment logic
lib/src/publication/remote.dart Updated constructor to pass track to parent instead of calling updateTrack()
lib/src/publication/local.dart Updated constructor to pass track to parent instead of calling updateTrack()

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

@hiroshihorie hiroshihorie merged commit 9e3f0ab into main Sep 8, 2025
10 of 11 checks passed
@hiroshihorie hiroshihorie deleted the hiroshi/fix-pub-track branch September 8, 2025 04:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants