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

feat(meetings): add ability to reclaim host role with hostKey #3291

Merged
merged 7 commits into from
Jan 17, 2024

Conversation

sreenara
Copy link
Contributor

@sreenara sreenara commented Jan 5, 2024

COMPLETES # SPARK-486926

This pull request addresses

The need to be able to reclaim the host role by any other participant in the meeting. This is especially useful in meetings where hosts of the meeting don't join and one of the guests has to take up the role of a host.

Refer #3272 and #3289 for the same functionality being added in the beta branch. This needed to be done in the master branch due to the release of USM.

Confluence document for reclaiming host.

by making the following changes

  1. Added the types required in members for the ServerRoleShape
  2. Added utility functions to create the required role object in the body from a member's parameters
  3. Added the assignRoles function to the members object which eventually triggers the request to assign caller as Host.

Change Type

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Documentation update
  • Tooling change
  • Internal code refactor

The following scenarios where tested

  1. Started a meeting using API
  2. Joined the meeting using the host on Webex desktop app
  3. Created a guest user and token. Joined the same meeting in Step 1 using this guest
  4. Triggered the new reclaim function using a button on the kitchen sink app along with the guest user's participant ID and hostKey. The desktop app now reflected the guest user as the host.
  5. Transferred host back to the original host of the meeting (desktop app)
  6. Triggered the reclaim action again using the kitchen sink page. Checked if the guest user was made host again.

I certified that

  • I have read and followed contributing guidelines

  • I discussed changes with code owners prior to submitting this pull request

  • I have not skipped any automated checks

  • All existing and new tests passed

  • I have updated the documentation accordingly

Test Results
plugin-meetings
members
...
#assignRoles
✔ should not make a request if there is no member id
✔ should not make a request if there is no locus url
✔ should not make a request if locus throws ReclaimHostNotSupportedError
✔ should not make a request if locus throws ReclaimHostNotAllowedError
✔ should not make a request if locus throws ReclaimHostEmptyWrongKeyError
✔ should not make a request if locus throws ReclaimHostIsHostAlreadyError
✔ should not make a request if locus throws a different error
✔ should make the correct request when called with roles
...

plugin-meetings
members utils library
#generateRaiseHandMemberOptions
✔ returns the correct options
#generateLowerAllHandsMemberOptions
✔ returns the correct options
#getAddedRoleShape
✔ returns the correct shape with hostkey
✔ returns the correct shape without hostkey
#getRoleAssignmentMemberRequestParams
✔ returns the correct request params
✔ returns the correct request params with a hostKey

Result
914 passing (2m)
11 pending
3 failing

  1. TurnDiscovery
    doTurnDiscovery
    resolves with undefined if the response does not have all the headers we expect:
    Error: Timeout of 30000ms exceeded. For async tests and hooks, ensure "done()" is called; if returning a Promise, ensure it resolves. (C:\Users\sreenara\stuff\webex-js-sdk\packages@webex\plugin-meetings\test\unit\spec\roap\turnDiscovery.ts)
    at listOnTimeout (node:internal/timers:559:17)
    at processTimers (node:internal/timers:502:7)

  2. TurnDiscovery
    doTurnDiscovery
    resolves with undefined if the response does not have any headers:
    Error: Timeout of 30000ms exceeded. For async tests and hooks, ensure "done()" is called; if returning a Promise, ensure it resolves. (C:\Users\sreenara\stuff\webex-js-sdk\packages@webex\plugin-meetings\test\unit\spec\roap\turnDiscovery.ts)
    at listOnTimeout (node:internal/timers:559:17)
    at processTimers (node:internal/timers:502:7)

  3. TurnDiscovery
    doTurnDiscovery
    resolves with undefined if the response has empty headers array:
    Error: Timeout of 30000ms exceeded. For async tests and hooks, ensure "done()" is called; if returning a Promise, ensure it resolves. (C:\Users\sreenara\stuff\webex-js-sdk\packages@webex\plugin-meetings\test\unit\spec\roap\turnDiscovery.ts)
    at listOnTimeout (node:internal/timers:559:17)
    at processTimers (node:internal/timers:502:7)


Make sure to have followed the contributing guidelines before submitting.

@sreenara sreenara added the validated If the pull request is validated for automation. label Jan 5, 2024
@sreenara sreenara requested review from a team as code owners January 5, 2024 10:04
@sreenara sreenara changed the base branch from next to master January 5, 2024 10:06
Copy link

This pull request is automatically being deployed by Amplify Hosting (learn more).

Access this pull request here: https://pr-3291.d3m3l2kee0btzx.amplifyapp.com

Copy link
Contributor

@Shreyas281299 Shreyas281299 left a comment

Choose a reason for hiding this comment

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

Just one small suggestion

* @param {RoleAssignmentOptions} options
* @returns {RoleAssignmentRequest} the request parameters (method, uri, body) needed to make a addMember request
*/
MembersUtil.getRoleAssignmentMemberRequestParams = (options: RoleAssignmentOptions) => {
Copy link
Contributor

Choose a reason for hiding this comment

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

I can see that beta branch has return type RoleAssignmentRequest, but that is not specified in this line

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Updated this @nataliadelmar

@sreenara sreenara merged commit 137b528 into webex:master Jan 17, 2024
12 of 13 checks passed
@sreenara sreenara deleted the reclaim-host branch January 17, 2024 12:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
validated If the pull request is validated for automation.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants