twilio-video.js icon indicating copy to clipboard operation
twilio-video.js copied to clipboard

Property logLevel is deprecated, but required in type 'LocalTrackOptions'

Open Talb2005 opened this issue 1 year ago • 2 comments

When creating a new LocalVideoTrack / LocalAudioTrack / LocalDataTrack, providing LocalTrackOptions with {name: 'track-name'} causes a Typescript error:

Argument of type '{ name: string; }' is not assignable to parameter of type 'LocalTrackOptions'.
  Property 'logLevel' is missing in type '{ name: string; }' but required in type 'LocalTrackOptions'.ts(2345)

Since logLevel is deprecated, it should at least be marked as optional, but is currently marked as a required property of LocalTrackOptions.

  • [X] I have verified that the issue occurs with the latest twilio-video.js release and is not marked as a known issue in the CHANGELOG.md.
  • [X] I reviewed the Common Issues and open GitHub issues and verified that this report represents a potentially new issue.
  • [X] I verified that the Quickstart application works in my environment.
  • [X] I am not sharing any Personally Identifiable Information (PII) or sensitive account information (API keys, credentials, etc.) when reporting this issue.

Code to reproduce the issue:

function toLocalVideoTrack(track: MediaStreamTrack): LocalVideoTrack {
            return new LocalVideoTrack(track, { name: 'camera' });
        }

Expected behavior:

No type error should occur when providing LocalTrackOptions without logLevel property.

Actual behavior:

Providing LocalTrackOptions without logLevel property causes a Typescript error.

TODO

Software versions:

  • [X] Browser(s): Not Applicable
  • [X] Operating System: macOS Monterey 12.4
  • [X] twilio-video.js: 2.22.0
  • [X] Third-party libraries (e.g., Angular, React, etc.): Angular 14

Talb2005 avatar Jul 06 '22 08:07 Talb2005

@Talb2005 ,

Thanks for reporting this issue. We are taking a look at it, and will get back to you with updates soon.

manjeshbhargav avatar Jul 07 '22 15:07 manjeshbhargav

I agree with the suggestion. I submitted an internal ticket to address this on a future release.

charliesantos avatar Jul 07 '22 17:07 charliesantos

@manjeshbhargav @charliesantos I've created a PR with a fix. I think you can just merge it and then close this issue..

Talb2005 avatar Aug 18 '22 05:08 Talb2005

Hi @Talb2005,

This issue has now been fixed on the latest version 2.24.1. Please let us know if you have any other issues!

Best, Joyce

PikaJoyce avatar Sep 07 '22 18:09 PikaJoyce