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: #15474 retrieve zoom usersettings and update zoom integration #15489

Merged
merged 11 commits into from
Aug 9, 2024

Conversation

vijayraghav-io
Copy link
Contributor

@vijayraghav-io vijayraghav-io commented Jun 19, 2024

What does this PR do?

This is generic implementation with zoomUserSettingsSchema defined , any future zoomUserSettings retrieval and corresponding logic update for create/update meetings or any.. can be easily extended.

Mandatory Tasks (DO NOT REMOVE)

  • I have self-reviewed the code (A decent size PR without self-review might be rejected)
  • I have added a Docs issue here if this PR makes changes that would require a documentation change
  • I have added or modified automated tests that prove my fix is effective or that my feature works (PRs might be rejected if logical changes are not properly tested)

@graphite-app graphite-app bot added the community Created by Linear-GitHub Sync label Jun 19, 2024
@graphite-app graphite-app bot requested a review from a team June 19, 2024 10:38
Copy link

vercel bot commented Jun 19, 2024

@vijayraghav-io is attempting to deploy a commit to the cal Team on Vercel.

A member of the Team first needs to authorize it.

@github-actions github-actions bot added calendar-apps area: calendar, google calendar, outlook, lark, microsoft 365, apple calendar 🐛 bug Something isn't working labels Jun 19, 2024
@dosubot dosubot bot added the app-store area: app store, apps, calendar integrations, google calendar, outlook, lark, apple calendar label Jun 19, 2024
Copy link

graphite-app bot commented Jun 19, 2024

Graphite Automations

"Add community label" took an action on this PR • (06/19/24)

1 label was added to this PR based on Keith Williams's automation.

"Add consumer team as reviewer" took an action on this PR • (06/19/24)

1 reviewer was added to this PR based on Keith Williams's automation.

@vijayraghav-io vijayraghav-io changed the title fix: #15474 retrieve zoom usersettings for zoom integration fix: #15474 retrieve zoom usersettings and update zoom integration Jun 19, 2024
@keithwillcode keithwillcode added this to the v4.4 milestone Jun 19, 2024
@PeerRich PeerRich added the Medium priority Created by Linear-GitHub Sync label Jun 21, 2024
@vijayraghav-io
Copy link
Contributor Author

all checks passed

Copy link
Contributor

@joeauyeung joeauyeung left a comment

Choose a reason for hiding this comment

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

Thanks for your contribution @vijayraghav-io. I just have one blocking comment.

export type ZoomUserSettings = z.infer<typeof zoomUserSettingsSchema>;

/** @link https://developers.zoom.us/docs/api/rest/reference/user/methods/#operation/userSettings */
export const zoomUserSettingsSchema = z.object({
Copy link
Contributor

Choose a reason for hiding this comment

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

I noticed we're only using the password and auto record settings. When making the API call can we filter for just those two properties.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

sure

Copy link
Contributor Author

@vijayraghav-io vijayraghav-io Jun 21, 2024

Choose a reason for hiding this comment

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

Copy link
Contributor

Choose a reason for hiding this comment

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

Awesome, can we also then clean up zoomUserSettingsSchema to only the fields we're filtering on. It'll help make reading the file easier.

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 can clean up.
I thought in future if any more settings is required to be retrieved , we already have the schema defined, need not again refer or search the zoom api doc.
Please share your thoughts.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@joeauyeung , updated

Copy link
Contributor

Choose a reason for hiding this comment

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

Our thought process is we only want code that is being used. If we need to access different user settings we can always add to the schema in the future.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

ok

Comment on lines 272 to 281
let userSettings: ZoomUserSettings | undefined;
try {
const filterResp = "default_password_for_scheduled_meetings,auto_recording";
const responseBody = await fetchZoomApi(`users/me/settings?custom_query_fields=${filterResp}`);
userSettings = zoomUserSettingsSchema.parse(responseBody);
} catch (err) {
console.error(err);
/* If user settings could not be retrieved due to error in like - api scope configurations,
just continue create meeting with default settings*/
}
Copy link
Contributor

Choose a reason for hiding this comment

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

Since we're repeating this functionality, can we abstract this into its own function? Maybe we can call that function inside of translate event.

Also we have to add a new scope to our Zoom app. If a user has not reauthenticated then that means this will always throw an error. can we add proper logging if that is the case?

Copy link
Contributor Author

@vijayraghav-io vijayraghav-io Jun 25, 2024

Choose a reason for hiding this comment

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

@joeauyeung updated

@vijayraghav-io
Copy link
Contributor Author

Hi @joeauyeung , all comments are addressed, reminding you on this PR.

@CarinaWolli
Copy link
Member

Hi @joeauyeung , all comments are addressed, reminding you on this PR.

@joeauyeung can you take a look again 🙏

Copy link
Contributor

github-actions bot commented Aug 6, 2024

This PR is being marked as stale due to inactivity.

@github-actions github-actions bot added the Stale label Aug 6, 2024
@vijayraghav-io
Copy link
Contributor Author

@joeauyeung , can you please review the required changes done and approve

@github-actions github-actions bot removed the Stale label Aug 7, 2024
Copy link
Contributor

@joeauyeung joeauyeung left a comment

Choose a reason for hiding this comment

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

Sorry for the delay, every thing looks good @vijayraghav-io. Thanks again for your contribution

@vijayraghav-io
Copy link
Contributor Author

Sorry for the delay, every thing looks good @vijayraghav-io. Thanks again for your contribution

Thankyou! @joeauyeung 🙏

@joeauyeung joeauyeung enabled auto-merge (squash) August 8, 2024 16:02
@joeauyeung joeauyeung merged commit a2998b6 into calcom:main Aug 9, 2024
28 of 35 checks passed
@milospuac
Copy link
Contributor

@joeauyeung @vijayraghav-io

Looks like this isn't fixed, auto record is still not engaging once the meeting starts
Screenshot 2024-08-21 at 08 49 25

@vijayraghav-io
Copy link
Contributor Author

vijayraghav-io commented Aug 21, 2024

I guess the specific scopes are not enabled/added here for cal app to access the zoom user settings.
This is account/user level setting to be done in zoom App marketplace.

https://developers.zoom.us/docs/api/rest/reference/user/ma/#operation/userSettings
Screenshot 2024-08-21 at 12 49 14 PM

https://developers.zoom.us/docs/integrations/oauth-scopes-overview/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
app-store area: app store, apps, calendar integrations, google calendar, outlook, lark, apple calendar 🐛 bug Something isn't working calendar-apps area: calendar, google calendar, outlook, lark, microsoft 365, apple calendar community Created by Linear-GitHub Sync Medium priority Created by Linear-GitHub Sync ready-for-e2e
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[CAL-3943] Zoom integration doesn't follow the zoom app settings for auto-record
6 participants