fix: Adds mandatory credentiaId in Destination Calendar API endpoint POST#11880
fix: Adds mandatory credentiaId in Destination Calendar API endpoint POST#11880
Conversation
|
The latest updates on your projects. Learn more about Vercel for Git ↗︎
3 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! |
📦 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✅ 149 Passing - Run may still be in progress, this comment will be updated as current testing workflow or job completes... (Last updated on 10/16/2023 08:15:42am UTC) Run DetailsRunning Workflow PR Update on Github Actions Commit: 9015b4d Started: 10/16/2023 08:12:27am UTC
|
|
|
5 Test Cases Affected |
Test Case Results
| Test Case | Last 7 days Failures | Last 7 days Flakes |
|---|---|---|
|
unauthorized user sees correct translations (de) should use correct translations and html attributes
Retry 2 • Retry 1 • Initial Attempt |
-146.51% (-63)-63 / 43 runsfailed over last 7 days |
146.51% (63)63 / 43 runsflaked over last 7 days |
|
unauthorized user sees correct translations (ar) should use correct translations and html attributes
Retry 2 • Retry 1 • Initial Attempt |
-146.51% (-63)-63 / 43 runsfailed over last 7 days |
146.51% (63)63 / 43 runsflaked over last 7 days |
|
authorized user sees correct translations (de) [locale1] should return correct translations and html attributes
Retry 2 • Retry 1 • Initial Attempt |
0% (0)0 / 42 runsfailed over last 7 days |
73.81% (31)31 / 42 runsflaked over last 7 days |
|
authorized user sees correct translations (ar) should return correct translations and html attributes
Retry 2 • Retry 1 • Initial Attempt |
-72.73% (-8)-8 / 11 runsfailed over last 7 days |
127.27% (14)14 / 11 runsflaked over last 7 days |
|
authorized user sees changed translations (de->ar) should return correct translations and html attributes
Retry 2 • Retry 1 • Initial Attempt |
-280% (-14)-14 / 5 runsfailed over last 7 days |
280% (14)14 / 5 runsflaked over last 7 days |
📄 apps/web/playwright/auth/delete-account.e2e.ts • 1 Flake
Test Case Results
| Test Case | Last 7 days Failures | Last 7 days Flakes |
|---|---|---|
|
Can delete user account
Retry 2 • Retry 1 • Initial Attempt |
1.34% (4)4 / 298 runsfailed over last 7 days |
13.76% (41)41 / 298 runsflaked over last 7 days |
📄 apps/web/playwright/booking-seats.e2e.ts • 1 Flake
Test Case Results
| Test Case | Last 7 days Failures | Last 7 days Flakes |
|---|---|---|
|
Reschedule for booking with seats Should reschedule booking with seats
Retry 1 • Initial Attempt |
0% (0)0 / 283 runsfailed over last 7 days |
0.71% (2)2 / 283 runsflaked over last 7 days |
📄 apps/web/playwright/manage-booking-questions.e2e.ts • 1 Flake
Test Case Results
| Test Case | Last 7 days Failures | Last 7 days Flakes |
|---|---|---|
|
Manage Booking Questions For User EventType Do a booking with a user added question and verify a few thing in b/w
Retry 1 • Initial Attempt |
2.85% (8)8 / 281 runsfailed over last 7 days |
0.71% (2)2 / 281 runsflaked over last 7 days |
📄 apps/web/playwright/change-username.e2e.ts • 1 Flake
Test Case Results
| Test Case | Last 7 days Failures | Last 7 days Flakes |
|---|---|---|
|
Change username on settings User can change username
Retry 1 • Initial Attempt |
1.74% (5)5 / 287 runsfailed over last 7 days |
26.83% (77)77 / 287 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 open embed iframe on click - Configured with light theme
Retry 1 • Initial Attempt |
2.35% (7)7 / 298 runsfailed over last 7 days |
32.21% (96)96 / 298 runsflaked over last 7 days |
|
Popup Tests should be able to reschedule
Retry 2 • Retry 1 • Initial Attempt |
7.07% (21)21 / 297 runsfailed over last 7 days |
91.58% (272)272 / 297 runsflaked over last 7 days |
alishaz-polymath
left a comment
There was a problem hiding this comment.
Self review added
| if (!parsedBody.eventTypeId) { | ||
| parsedBody.userId = userId; | ||
| } | ||
| const assignedUserId = isAdmin ? parsedBody.userId || userId : userId; |
There was a problem hiding this comment.
assignedUserId is the one for whom the destination calendar is being created. In case of connection with an eventTypeId, we simply use this to validate their ownership of the eventTypeId passed in the request.
| const credential = await prisma.credential.findFirst({ | ||
| where: { type: parsedBody.integration, userId: assignedUserId }, | ||
| select: { id: true, type: true, userId: true }, | ||
| }); |
There was a problem hiding this comment.
We check if an entry exists in credential table for the assignedUserId & integration
| statusCode: 400, | ||
| message: "Bad request, eventTypeId invalid", | ||
| }); | ||
| parsedBody.userId = undefined; |
There was a problem hiding this comment.
If the body contains an eventTypeId, it means the destination calendar needs to be related to an event type instead, and so we make sure userId inside the parsedBody is not defined.

What does this PR do?
This PR adds
credentialIdto be passed as a mandatory input to allow linking with theCredentialtable. Without this, there's a strong possibility of unexpected issues. If someone goes to add a destination calendar, the relationship with the respective credential link would be missing from theDestinationCalendartable & theCredentialtable and hence, would probably experience some form of side-effects and potentially impact the main flow of createEvent in EventManager.Requirement/Documentation
Type of change
How should this be tested?
Mandatory Tasks
Checklist