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

Set up an endpoint for meeting rooms #1693

Merged
merged 3 commits into from
Apr 24, 2023
Merged

Set up an endpoint for meeting rooms #1693

merged 3 commits into from
Apr 24, 2023

Conversation

mjh1
Copy link
Contributor

@mjh1 mjh1 commented Apr 19, 2023

What does this pull request do? Explain your changes. (required)

Provides a new endpoint to be able to create meeting rooms for multi-participant live streams.

How did you test each of these updates (required)

Ran the app locally with yarn dev and tested with different requests to the new endpoint. There is also a unit test provided.

Does this pull request close any open issues?

Checklist

  • I have read the CONTRIBUTING document.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have added tests to cover my changes.

@mjh1 mjh1 requested a review from a team as a code owner April 19, 2023 08:58
@vercel
Copy link

vercel bot commented Apr 19, 2023

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
livepeer-studio ✅ Ready (Inspect) Visit Preview 💬 Add feedback Apr 21, 2023 0:28am

@codecov
Copy link

codecov bot commented Apr 19, 2023

Codecov Report

Merging #1693 (01c76a3) into master (7341a28) will increase coverage by 0.06318%.
The diff coverage is 76.92308%.

Impacted file tree graph

@@                 Coverage Diff                 @@
##              master       #1693         +/-   ##
===================================================
+ Coverage   53.02876%   53.09194%   +0.06318%     
===================================================
  Files             74          75          +1     
  Lines           4903        4916         +13     
  Branches         976         977          +1     
===================================================
+ Hits            2600        2610         +10     
- Misses          1970        1972          +2     
- Partials         333         334          +1     
Impacted Files Coverage Δ
packages/api/src/parse-cli.ts 34.04255% <ø> (ø)
packages/api/src/controllers/room.ts 75.00000% <75.00000%> (ø)
packages/api/src/test-server.ts 93.18182% <100.00000%> (+0.15856%) ⬆️

Continue to review full report in Codecov by Sentry.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 7341a28...01c76a3. Read the comment docs.

Impacted Files Coverage Δ
packages/api/src/parse-cli.ts 34.04255% <ø> (ø)
packages/api/src/controllers/room.ts 75.00000% <75.00000%> (ø)
packages/api/src/test-server.ts 93.18182% <100.00000%> (+0.15856%) ⬆️

packages/api/src/controllers/room.ts Dismissed Show dismissed Hide dismissed
Copy link
Member

@victorges victorges left a comment

Choose a reason for hiding this comment

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

LGTM!

}

const id = uuid();
const svc = new RoomServiceClient(
Copy link
Member

Choose a reason for hiding this comment

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

Is it ok to create one of these on every request? If there are definite gains in having a single instance lmk and we can work sth out, like putting it on the req object as well

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yeah I wondered that too, when I asked livekit they said it should be ok:

either way works! it's pretty inexpensive to create each time

Sound ok to you or should we press further?

Copy link
Member

Choose a reason for hiding this comment

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

Sounds good for now!

emptyTimeout: 30 * 60,
maxParticipants: 2,
};
const room = await svc.createRoom(opts);
Copy link
Member

Choose a reason for hiding this comment

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

Do we not need to create a stream anymore? So there will be a separate call to have the room be livestreamed, is that it?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

That's right, since Hunter mentioned that not every room will have a live stream i've kept it separate.

/room:
post:
description: create a new room
responses:
Copy link
Member

Choose a reason for hiding this comment

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

Since you're adding it here, mind documenting the success respnose schema? can just do an inline schema here with an id field etc

Comment on lines +4 to +7
import { RoomServiceClient } from "livekit-server-sdk";
jest.mock("livekit-server-sdk");
const MockedRoomServiceClient =
RoomServiceClient as jest.Mock<RoomServiceClient>;
Copy link
Member

Choose a reason for hiding this comment

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

Maybe these should be the first lines in this file, just in case anyone changes the impl to use the mocked stuff statically (or this is really magic and I don't know how it works)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

What do you mean by using the mocked stuff statically?

Copy link
Member

Choose a reason for hiding this comment

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

e.g.: if we moved the livekit client creation to the "file root" or server creation level, not creating one on every request

That could run before the mocks are setup and get the wrong result. Not a huge priority since it works now though, it's fine as is

packages/api/src/controllers/room.test.ts Show resolved Hide resolved
@mjh1 mjh1 merged commit 19fe4a0 into master Apr 24, 2023
11 checks passed
@mjh1 mjh1 deleted the mh/livekit branch April 24, 2023 15:08
suhailkakar pushed a commit that referenced this pull request May 4, 2023
* Set up an endpoint for meeting rooms

* Add unit test

* fix test
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.

None yet

2 participants