-
Notifications
You must be signed in to change notification settings - Fork 7.9k
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: google meet no show #17271
base: main
Are you sure you want to change the base?
feat: google meet no show #17271
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎ 2 Skipped Deployments
|
Hey there and thank you for opening this pull request! 👋🏼 We require pull request titles to follow the Conventional Commits specification and it looks like your proposed title needs to be adjusted. Details: |
New and removed dependencies detected. Learn more about Socket for GitHub ↗︎
|
export const SCOPE_USERINFO_EMAIL = "https://www.googleapis.com/auth/userinfo.email"; | ||
|
||
export const REQUIRED_SCOPES = [SCOPE_CALENDAR_READONLY, SCOPE_CALENDAR_EVENT]; | ||
export const SCOPE_USER_CONTACTS = "https://www.googleapis.com/auth/contacts.readonly"; | ||
export const SCOPE_OTHER_USER_CONTACTS = "https://www.googleapis.com/auth/contacts.other.readonly"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Need these scope to fetch user's workspace accounts email.
@@ -1,7 +1,18 @@ | |||
export const SCOPE_USERINFO_PROFILE = "https://www.googleapis.com/auth/userinfo.profile"; | |||
export const SCOPE_CALENDAR_READONLY = "https://www.googleapis.com/auth/calendar.readonly"; | |||
export const SCOPE_CALENDAR_EVENT = "https://www.googleapis.com/auth/calendar.events"; | |||
export const GOOGLE_MEET_API = "https://www.googleapis.com/auth/meetings.space.readonly"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Need this scope to fetch details about meeting and fetch participants
// TODO: is this correct? | ||
const destinationCalendar = destinationCalendars?.find((cal) => cal.userId === organizerUser.id); | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we need the destination calendar of the organizer (that created the google meet url).
if ( | ||
!!dailyVideoReference && | ||
(booking.location === DailyLocationType || booking.location?.trim() === "" || !booking.location) | ||
) { | ||
const meetingDetails = await getMeetingSessionsFromRoomName(dailyVideoReference.uid); | ||
|
||
const allParticipants = meetingDetails.data.flatMap((meeting) => meeting.participants); | ||
|
||
const hostsThatDidntJoinTheCall = hosts.filter( | ||
(host) => !checkIfUserJoinedTheCall(host.id, allParticipants) | ||
); | ||
|
||
const numberOfHostsThatJoined = hosts.length - hostsThatDidntJoinTheCall.length; | ||
|
||
const didGuestJoinTheCall = meetingDetails.data.some( | ||
(meeting) => meeting.max_participants < numberOfHostsThatJoined | ||
); | ||
|
||
return { | ||
hostsThatDidntJoinTheCall, | ||
booking, | ||
numberOfHostsThatJoined, | ||
webhook, | ||
didGuestJoinTheCall, | ||
triggerEvent, | ||
}; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this is same as before
const googleAuth = new GoogleAuth({ | ||
authClient: new OAuth2Client({ | ||
credentials: { | ||
access_token: token.access_token, | ||
}, | ||
}), | ||
}); | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It was throwing type error when i used the Google auth client in this class so i had to create this one
const spaceName = spaceInfo[0].name; | ||
|
||
const conferenceRecords = []; | ||
for await (const response of meetClient.listConferenceRecordsAsync()) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
meetClient.listConferenceRecordsAsync()
returns all conference records which were created by the user. conference record refers to a meeting.
const conferenceRecords = []; | ||
for await (const response of meetClient.listConferenceRecordsAsync()) { | ||
if (response.space === spaceName) { | ||
conferenceRecords.push(response); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we only want the conference record on our meeting url
const response = await fetch( | ||
`https://people.googleapis.com/v1/people/${ | ||
participant.signedinUser?.user?.split("/")[1] | ||
}?personFields=emailAddresses`, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fetch email here by id
Graphite Automations"Add consumer team as reviewer" took an action on this PR • (10/24/24)1 reviewer was added to this PR based on Keith Williams's automation. |
@@ -77,6 +77,14 @@ export default function EditOAuthClientWebhooks() { | |||
value: WebhookTriggerEvents.AFTER_GUESTS_CAL_VIDEO_NO_SHOW, | |||
label: "after_guests_cal_video_no_show", | |||
}, | |||
{ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should these be separate per video type? Seems like it should be AFTER_HOSTS_NO_SHOW
and AFTER_GUESTS_NO_SHOW
no matter which video type they used.
const noShowPromises: Promise<any>[] = []; | ||
|
||
const subscribersHostsNoShowStarted = await getWebhooks({ | ||
const hostNoShowTriggerEvent = isDailyVideoLocation |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
My previous comment applies here. This list will continue to grow larger and larger for the more video integrations we detect no shows for. Do we absolutely have to do this?
What does this PR do?
Mandatory Tasks (DO NOT REMOVE)
How should this be tested?
If you also want to test triggerHostNoShow then in L63 packages/features/bookings/lib/handleNewBooking/scheduleNoShowTriggers.ts add this code