fix: Duplicate Calendar Invites on rescheduling an accepted booking that requires confirmation#11827
Conversation
|
The latest updates on your projects. Learn more about Vercel for Git ↗︎
2 Ignored Deployments
|
|
Thank you for following the naming conventions! 🙏 Feel free to join our discord and post your PR link to collect XP and win prizes! |
| }; | ||
| }; | ||
|
|
||
| export const deleteEvent = async ( |
There was a problem hiding this comment.
It was unused method, started using it and fixed it.
| videoCredential = this.videoCredentials | ||
| // Whenever a new video connection is added, latest credentials are added with the highest ID. | ||
| // Because you can't rely on having them in the highest first order here, ensure this by sorting in DESC order | ||
| .sort((a, b) => { |
There was a problem hiding this comment.
Sort does the sorting in place, so it modifies this.videoCredentials itself. Moved this sorting to constructor to make the intention more clear and so that others don't need to do it again.
📦 Next.js Bundle Analysis for @calcom/webThis analysis was generated by the Next.js Bundle Analysis action. 🤖 This PR introduced no changes to the JavaScript bundle! 🙌 |
Current Playwright Test Results Summary✅ 147 Passing - Run may still be in progress, this comment will be updated as current testing workflow or job completes... (Last updated on 10/12/2023 05:33:33am UTC) Run DetailsRunning Workflow PR Update on Github Actions Commit: 4a361d0 Started: 10/12/2023 05:31:05am UTC
|
| Test Case | Last 7 days Failures | Last 7 days Flakes |
|---|---|---|
|
2FA Tests should allow a user to enable 2FA and login using 2FA
Retry 1 • Initial Attempt |
1.37% (4)4 / 291 runsfailed over last 7 days |
36.08% (105)105 / 291 runsflaked over last 7 days |
📄 packages/embeds/embed-core/playwright/tests/action-based.e2e.ts • 2 Flakes
Top 1 Common Error Messages
|
|
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 1 • Initial Attempt |
5.25% (16)16 / 305 runsfailed over last 7 days |
94.10% (287)287 / 305 runsflaked over last 7 days |
|
Popup Tests Floating Button Popup Pro User - Configured in App with default setting of system theme should open embed iframe according to system theme when no theme is configured through Embed API
Retry 1 • Initial Attempt |
2.29% (7)7 / 306 runsfailed over last 7 days |
18.95% (58)58 / 306 runsflaked over last 7 days |
46581f0 to
3ec69ad
Compare
| reference.type.includes("_calendar") | ||
| ); | ||
| // There was a case that booking didn't had any reference and we don't want to throw error on function | ||
| if (bookingCalendarReference) { |
There was a problem hiding this comment.
Extracted out in a variable.
| // If the reschedule doesn't require confirmation, we can "update" the events and meetings to new time. | ||
| const isDedicated = evt.location ? isDedicatedIntegration(evt.location) : null; | ||
| // If and only if event type is a dedicated meeting, update the dedicated video meeting. | ||
| if (isDedicated) { | ||
| const result = await this.updateVideoEvent(evt, booking); | ||
| const [updatedEvent] = Array.isArray(result.updatedEvent) | ||
| ? result.updatedEvent | ||
| : [result.updatedEvent]; | ||
|
|
||
| if (updatedEvent) { | ||
| evt.videoCallData = updatedEvent; |
There was a problem hiding this comment.
Moved existing code into this else condition
7021226 to
fa50c7c
Compare
fa50c7c to
73db1d5
Compare
| }, | ||
| }; | ||
| } | ||
| if (booking.attendees) { |
There was a problem hiding this comment.
Support creating fake attendees as well.
| }); | ||
| }, | ||
| deleteEvent: async (...rest: any[]) => { | ||
| log.silly("mockCalendar.deleteEvent", JSON.stringify({ rest })); |
There was a problem hiding this comment.
Verify deleteEvent calls
| }); | ||
| }, | ||
| deleteMeeting: async (...rest: any[]) => { | ||
| log.silly("MockVideoApiAdapter.deleteMeeting", JSON.stringify(rest)); |
There was a problem hiding this comment.
Allow verifying deleteMeeting calls
| // Whenever a new video connection is added, latest credentials are added with the highest ID. | ||
| // Because you can't rely on having them in the highest first order here, ensure this by sorting in DESC order | ||
| // We also don't have updatedAt or createdAt dates on credentials so this is the best we can do | ||
| .sort((a, b) => { | ||
| return b.id - a.id; | ||
| }); |
There was a problem hiding this comment.
Moved here from other place.
…ooking requires confirmation
…r-events-for-rescheduled-booking
…hm in separate PR
73db1d5 to
4a361d0
Compare
| ); | ||
|
|
||
| // eslint-disable-next-line playwright/no-skipped-test | ||
| test.skip( |
There was a problem hiding this comment.
Wrote the following 2 tests but they were failing as there is bug in identifying properly when an organizer reschedules the booking. Fill fix it in the followup PR as that's taking time.
CarinaWolli
left a comment
There was a problem hiding this comment.
Tested and works. Code looks good as well 🙏
What does this PR do?
Fixes #8444
Reason behind the issue was simply that the code always assumed that rescheduling would move the calendar invite to new time but in case of a booking that requires confirmation it is not true as the booking goes to PENDING state on reschedule.
Added a test as well for the flow
Before Fix - Loom
After Fix - Loom
Type of change
How should this be tested?
Mandatory Tasks