Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix ingress creation parameter inline documentation #296

Merged
merged 8 commits into from
Oct 11, 2024

Conversation

biglittlebigben
Copy link
Contributor

No description provided.

Copy link

changeset-bot bot commented Oct 11, 2024

🦋 Changeset detected

Latest commit: 681011e

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
livekit-server-sdk Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

*/
roomName?: string;
/**
* unique identity of the participant. optional
* unique identity of the participant.
*/
participantIdentity?: string;
Copy link
Member

Choose a reason for hiding this comment

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

since they are not optional, we shouldn't make them ?. and should move these to the top?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Would that potentially break any existing code using the SDK?

Copy link
Member

Choose a reason for hiding this comment

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

if this is required, then existing code would either have to set it, or it wouldn't be successful either way, right?

@@ -67,11 +67,11 @@ export interface UpdateIngressOptions {
*/
name: string;
/**
* name of the room to send media to. optional
* name of the room to send media to.
Copy link
Member

Choose a reason for hiding this comment

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

this is optional right? on updates.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Everything is optional in the dictionary in the sense that parameters left out will not be updated. It's odd to single out these 2 parameters. We could flag all parameters as optional, but this seems redundant on a parameter called "UpdateIngressOptions".

Copy link
Member

Choose a reason for hiding this comment

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

got it.. makes sense.

@@ -67,11 +67,11 @@ export interface UpdateIngressOptions {
*/
name: string;
/**
* name of the room to send media to. optional
* name of the room to send media to.
Copy link
Member

Choose a reason for hiding this comment

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

got it.. makes sense.

packages/livekit-server-sdk/src/IngressClient.ts Outdated Show resolved Hide resolved
name = opts.name || '';
roomName = opts.roomName;
participantName = opts.participantName || '';
participantIdentity = opts.participantIdentity || '';
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
participantIdentity = opts.participantIdentity || '';
participantIdentity = opts.participantIdentity;

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I also want to fail if the parameter is specifically set, but to an empty string. Is there a better way to achieve this (beyond 2 tests in the if statement below)?

throw new Error('options dictionary is required');
}

name = opts.name || '';
Copy link
Member

Choose a reason for hiding this comment

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

need consts in front of these

@biglittlebigben biglittlebigben merged commit b03ed37 into main Oct 11, 2024
7 checks passed
@biglittlebigben biglittlebigben deleted the benjamin/inline_docs branch October 11, 2024 22:42
@github-actions github-actions bot mentioned this pull request Oct 11, 2024
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