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: videoCallUrl not updating when rescheduling with a broken Calendar integration #11923

Merged
merged 4 commits into from
Oct 17, 2023

Conversation

hariombalhara
Copy link
Member

@hariombalhara hariombalhara commented Oct 16, 2023

What does this PR do?

Fixes, videoCallUrl not updating when rescheduling with a broken Calendar integration

  • Added an asssertion that verifies that it works now.
  • Added assertion to verify appsStatus also in email
  • Started using node-html-parser to easily test more things in email HTML

More details https://threads.com/34542266165?s=iejN9Cku3XDgLFAaAXrKBo

Type of change

  • Bug fix (non-breaking change which fixes an issue)

How should this be tested?

  • Connect Google Calendar and setup Daily Video
  • Book a meeting with an event-type that uses the Google Calendar and has Daily Video as location
  • Go to Credential table and modify refresh_token and access_token for Google Calendar so that it can no longer fix itself
  • Reschedule the previous booking and notice that it is giving the previous Cal Video URL instead of a new one corresponding to the new booking UID.

Mandatory Tasks

  • Make sure you have self-reviewed the code. A decent size PR without self-review might be rejected.

@vercel
Copy link

vercel bot commented Oct 16, 2023

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

Name Status Preview Comments Updated (UTC)
ai ✅ Ready (Inspect) Visit Preview 💬 Add feedback Oct 17, 2023 10:11am
api ✅ Ready (Inspect) Visit Preview 💬 Add feedback Oct 17, 2023 10:11am
cal-demo ✅ Ready (Inspect) Visit Preview 💬 Add feedback Oct 17, 2023 10:11am
dev ✅ Ready (Inspect) Visit Preview 💬 Add feedback Oct 17, 2023 10:11am
3 Ignored Deployments
Name Status Preview Comments Updated (UTC)
cal ⬜️ Ignored (Inspect) Visit Preview Oct 17, 2023 10:11am
qa ⬜️ Ignored (Inspect) Visit Preview Oct 17, 2023 10:11am
ui ⬜️ Ignored (Inspect) Visit Preview Oct 17, 2023 10:11am

@github-actions
Copy link
Contributor

github-actions bot commented Oct 16, 2023

Thank you for following the naming conventions! 🙏 Feel free to join our discord and post your PR link to collect XP and win prizes!

@zomars zomars added the core area: core, team members only label Oct 16, 2023
if (parsedBody.payload.metadata?.videoCallUrl) {
parsedBody.payload.metadata.videoCallUrl = parsedBody.payload.metadata.videoCallUrl
? parsedBody.payload.metadata.videoCallUrl.replace(/\/video\/[a-zA-Z0-9]{22}/, "/video/DYNAMIC_UID")
Copy link
Member Author

Choose a reason for hiding this comment

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

Instead of considering every UID as DYNAMIC_UID, actually test the value as there was a bug that could have found if we were checking that.

@github-actions
Copy link
Contributor

github-actions bot commented Oct 16, 2023

📦 Next.js Bundle Analysis for @calcom/web

This analysis was generated by the Next.js Bundle Analysis action. 🤖

This PR introduced no changes to the JavaScript bundle! 🙌

@deploysentinel
Copy link

deploysentinel bot commented Oct 16, 2023

Current Playwright Test Results Summary

✅ 162 Passing - ⚠️ 8 Flaky

Run may still be in progress, this comment will be updated as current testing workflow or job completes...

(Last updated on 10/17/2023 10:14:04am UTC)

Run Details

Running Workflow PR Update on Github Actions

Commit: 1a0367b

Started: 10/17/2023 10:10:21am UTC

⚠️ Flakes

📄   apps/web/playwright/login.2fa.e2e.ts • 1 Flake

Test Case Results

Test Case Last 7 days Failures Last 7 days Flakes
2FA Tests should allow a user to enable 2FA and login using 2FA
Retry 1Initial Attempt
1.75% (5) 5 / 286 runs
failed over last 7 days
30.77% (88) 88 / 286 runs
flaked over last 7 days

📄   apps/web/playwright/integrations-stripe.e2e.ts • 1 Flake

Test Case Results

Test Case Last 7 days Failures Last 7 days Flakes
Stripe integration Paid booking should be able to be rescheduled
Retry 1Initial Attempt
3.32% (10) 10 / 301 runs
failed over last 7 days
6.31% (19) 19 / 301 runs
flaked over last 7 days

📄   packages/embeds/embed-core/playwright/tests/action-based.e2e.ts • 2 Flakes

Top 1 Common Error Messages

null

2 Test Cases Affected

Test Case Results

Test Case Last 7 days Failures Last 7 days Flakes
Popup Tests should be able to reschedule
Retry 2Retry 1Initial Attempt
9.21% (28) 28 / 304 runs
failed over last 7 days
89.14% (271) 271 / 304 runs
flaked over last 7 days
Popup Tests should open embed iframe on click - Configured with light theme
Retry 1Initial Attempt
3.61% (11) 11 / 305 runs
failed over last 7 days
35.74% (109) 109 / 305 runs
flaked over last 7 days

📄   apps/web/playwright/onboarding.e2e.ts • 1 Flake

Test Case Results

Test Case Last 7 days Failures Last 7 days Flakes
Onboarding Onboarding v2 Onboarding Flow
Retry 1Initial Attempt
0% (0) 0 / 300 runs
failed over last 7 days
1% (3) 3 / 300 runs
flaked over last 7 days

📄   packages/embeds/embed-core/playwright/tests/preview.e2e.ts • 1 Flake

Test Case Results

Test Case Last 7 days Failures Last 7 days Flakes
Preview Preview - embed-core should load
Retry 1Initial Attempt
0% (0) 0 / 302 runs
failed over last 7 days
5.30% (16) 16 / 302 runs
flaked over last 7 days

📄   apps/web/playwright/teams.e2e.ts • 1 Flake

Test Case Results

Test Case Last 7 days Failures Last 7 days Flakes
Teams Non admin team members cannot create team in org
Retry 1Initial Attempt
0% (0) 0 / 41 runs
failed over last 7 days
26.83% (11) 11 / 41 runs
flaked over last 7 days

📄   packages/embeds/embed-core/playwright/tests/inline.e2e.ts • 1 Flake

Test Case Results

Test Case Last 7 days Failures Last 7 days Flakes
Inline Iframe Inline Iframe - Configured with Dark Theme
Retry 1Initial Attempt
3.64% (11) 11 / 302 runs
failed over last 7 days
12.25% (37) 37 / 302 runs
flaked over last 7 days

View Detailed Build Results


@@ -2134,7 +2133,8 @@ async function handler(
}
return prev;
}, {} as { [key: string]: AppsStatus });
evt.appsStatus = Object.values(calcAppsStatus);
resultStatus = Object.values(calcAppsStatus);
return resultStatus;
Copy link
Member Author

@hariombalhara hariombalhara Oct 16, 2023

Choose a reason for hiding this comment

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

Return resultStatus instead of setting it directly on evt in the function. evt isn't an argument passed to the function.

It makes it more clear to understand what handleAppStatus is doing

cancellationReason: `$RCH$${rescheduleReason ? rescheduleReason : ""}`, // Removable code prefix to differentiate cancellation from rescheduling for email
});
}
const { metadata, videoCallUrl: _videoCallUrl } = getVideoCallDetails({
Copy link
Member Author

Choose a reason for hiding this comment

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

It's possible that only Calendar Integration may have failed, so we still have a new video URL.

results,
});

videoCallUrl = _videoCallUrl;
Copy link
Member Author

Choose a reason for hiding this comment

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

Update the out of block scope variable videoCallUrl

});

videoCallUrl = _videoCallUrl;
evt.appsStatus = handleAppsStatus(results, booking);
Copy link
Member Author

Choose a reason for hiding this comment

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

We should be able to call handleAppsStatus regardless of updateEvent presence. The function itself checks for results.

@hariombalhara hariombalhara changed the title Fix videoCallUrl not updating when rescheduling with Calendar integra… fix: videoCallUrl not updating when rescheduling with a broken Calendar integration Oct 16, 2023
@hariombalhara hariombalhara force-pushed the fix/videoCallUrl-not-updating-in-reschedule branch from 867e916 to 8215312 Compare October 16, 2023 15:51
});

expectBookingRescheduledWebhookToHaveBeenFired({
booker,
organizer,
location: BookingLocations.CalVideo,
subscriberUrl: "http://my-webhook.example.com",
videoCallUrl: `${WEBAPP_URL}/video/DYNAMIC_UID`,
videoCallUrl: `${WEBAPP_URL}/video/${createdBooking.uid}`,
Copy link
Member Author

Choose a reason for hiding this comment

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

Test the CalVideo URL completely.

@@ -577,16 +592,27 @@ describe("handleNewBooking", () => {
},
to: {
description: "",
location: "New York",
location: "integrations:daily",
Copy link
Member Author

Choose a reason for hiding this comment

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

Updated the test to use DailyVideo has location during reschedule

Copy link
Contributor

@Udit-takkar Udit-takkar left a comment

Choose a reason for hiding this comment

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

@hariombalhara so i got the correct meeting link on the booking page but i didn't got any email about rescheduling of meeting or that my integration in broken

@PeerRich PeerRich added High priority Created by Linear-GitHub Sync bookings area: bookings, availability, timezones, double booking labels Oct 17, 2023
@hariombalhara
Copy link
Member Author

Yeah that is a known issue @Udit-takkar. It needs to be tackled separately.
#8197

In such case a broken integration email should be sent ideally. Also, we have considered even disabling the booking page itself if Google Calendar isn't connected correctly.
https://threads.com/34541026838?s=dAytZR5kvGHFyWgPAQ9Jv3

metadata.conferenceData = updatedEvent.conferenceData;
metadata.entryPoints = updatedEvent.entryPoints;
handleAppsStatus(results, booking);
videoCallUrl = metadata.hangoutLink || videoCallUrl || updatedEvent?.url;
Copy link
Member Author

Choose a reason for hiding this comment

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

At this moment videoCallUrl is undefined. So, we could just remove the middle videoCallUrl in ORing

Copy link
Contributor

@Udit-takkar Udit-takkar left a comment

Choose a reason for hiding this comment

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

LGTM

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bookings area: bookings, availability, timezones, double booking core area: core, team members only High priority Created by Linear-GitHub Sync
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants