fix: unhandled promise error in scheduleEmailReminders endpoint#12183
fix: unhandled promise error in scheduleEmailReminders endpoint#12183CarinaWolli merged 5 commits intomainfrom
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! |
| }; | ||
| }>; | ||
|
|
||
| function getiCalEventAsString( |
There was a problem hiding this comment.
moved this function to /lib folder to improve readability of this enpoint
| import { parseRecurringEvent } from "@calcom/lib"; | ||
| import type { Prisma, User } from "@calcom/prisma/client"; | ||
|
|
||
| type Booking = Prisma.BookingGetPayload<{ |
There was a problem hiding this comment.
just copied everything form above
| } | ||
|
|
||
| deletePromises.push( | ||
| remindersToDelete.map((reminder) => |
There was a problem hiding this comment.
Resulted in a two-dimensional array and this caused issues with Promise.allSettled not working correctly (Unhandled Promise Rejection)
📦 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✅ 251 Passing - Run may still be in progress, this comment will be updated as current testing workflow or job completes... (Last updated on 11/03/2023 01:37:29pm UTC) Run DetailsRunning Workflow PR Update on Github Actions Commit: 801f14d Started: 11/03/2023 01:32:53pm UTC
|
|
|
2 Test Cases Affected |
Test Case Results
| Test Case | Last 7 days Failures | Last 7 days Flakes |
|---|---|---|
|
Booking With Long Text Question and Each Other Question Booking With Long Text Question and checkbox Question Long Text and checkbox required
Retry 1 • Initial Attempt |
0% (0)0 / 228 runsfailed over last 7 days |
0.88% (2)2 / 228 runsflaked over last 7 days |
|
Booking With Long Text Question and Each Other Question Long Text required and Number not required
Retry 1 • Initial Attempt |
0% (0)0 / 228 runsfailed over last 7 days |
0.88% (2)2 / 228 runsflaked over last 7 days |
📄 packages/embeds/embed-core/playwright/tests/action-based.e2e.ts • 1 Flake
Test Case Results
| Test Case | Last 7 days Failures | Last 7 days Flakes |
|---|---|---|
|
Popup Tests should be able to reschedule
Retry 1 • Initial Attempt |
21.71% (61)61 / 281 runsfailed over last 7 days |
75.44% (212)212 / 281 runsflaked over last 7 days |
Udit-takkar
left a comment
There was a problem hiding this comment.
NIT: use logger.error instead of console.log
Promise.allSettled(allPromisesCancelReminders).then((results) => {
results.forEach((result) => {
if (result.status === "rejected") {
console.log(`Error cancelling scheduled_sends: ${result.reason}`);
}
});
});
code LGTM
Co-authored-by: CarinaWolli <wollencarina@gmail.com>
What does this PR do?
Requirement/Documentation
Type of change