Skip to content

An empty array is truthy, [0] potentially isn't#7961

Merged
emrysal merged 1 commit intomainfrom
bugfix/allow-empty-references
Mar 27, 2023
Merged

An empty array is truthy, [0] potentially isn't#7961
emrysal merged 1 commit intomainfrom
bugfix/allow-empty-references

Conversation

@emrysal
Copy link
Copy Markdown
Contributor

@emrysal emrysal commented Mar 27, 2023

What does this PR do?

Fixes a 500 Error during cancel (Only happens when the video fallback is broken, but worth fixing still) - self hosters might experience this.

prisma:query SELECT "public"."Webhook"."id", "public"."Webhook"."subscriberUrl", "public"."Webhook"."payloadTemplate", "public"."Webhook"."appId", "public"."Webhook"."secret" FROM "public"."Webhook" WHERE (("public"."Webhook"."userId" = $1 OR "public"."Webhook"."eventTypeId" = $2) AND "public"."Webhook"."eventTriggers" @> $3 AND "public"."Webhook"."active" = $4) OFFSET $5 
prisma:query BEGIN
prisma:query SELECT "public"."Booking"."id" FROM "public"."Booking" WHERE ("public"."Booking"."uid" = $1 AND 1=1) 
prisma:query UPDATE "public"."Booking" SET "status" = $1, "cancellationReason" = $2 WHERE ("public"."Booking"."id" IN ($3) AND ("public"."Booking"."uid" = $4 AND 1=1)) 
prisma:query SELECT "public"."Booking"."id", "public"."Booking"."startTime", "public"."Booking"."endTime", "public"."Booking"."uid", "public"."Booking"."scheduledJobs" FROM "public"."Booking" WHERE "public"."Booking"."id" = $1 LIMIT $2 OFFSET $3 
prisma:query SELECT "public"."BookingReference"."id", "public"."BookingReference"."uid", "public"."BookingReference"."type", "public"."BookingReference"."externalCalendarId", "public"."BookingReference"."credentialId", "public"."BookingReference"."bookingId" FROM "public"."BookingReference" WHERE "public"."BookingReference"."bookingId" IN ($1) OFFSET $2
prisma:query SELECT "public"."WorkflowReminder"."id", "public"."WorkflowReminder"."bookingUid", "public"."WorkflowReminder"."method", "public"."WorkflowReminder"."scheduledDate", "public"."WorkflowReminder"."referenceId", "public"."WorkflowReminder"."scheduled", "public"."WorkflowReminder"."workflowStepId", "public"."WorkflowReminder"."cancelled" FROM "public"."WorkflowReminder" WHERE "public"."WorkflowReminder"."bookingUid" IN ($1) OFFSET $2
prisma:query COMMIT
TypeError: Cannot read properties of undefined (reading 'uid')
    at /var/task/apps/web/.next/server/pages/api/cancel.js:1367:65
    at Array.forEach (<anonymous>)
    at handler (/var/task/apps/web/.next/server/pages/api/cancel.js:1366:99)
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
    at async handler (/var/task/apps/web/.next/server/pages/api/cancel.js:661:12)
    at async /var/task/apps/web/.next/server/chunks/7810.js:58:28
    at async /var/task/apps/web/.next/server/chunks/4358.js:717:13
    at async Object.apiResolver (/var/task/node_modules/next/dist/server/api-utils/node.js:372:9)
    at async NextNodeServer.runApi (/var/task/node_modules/next/dist/server/next-server.js:513:9)
    at async Object.fn (/var/task/node_modules/next/dist/server/next-server.js:815:35)
    at async Router.execute (/var/task/node_modules/next/dist/server/router.js:243:32)
    at async NextNodeServer.runImpl (/var/task/node_modules/next/dist/server/base-server.js:432:29)
    at async NextNodeServer.handleRequestImpl (/var/task/node_modules/next/dist/server/base-server.js:375:20)
    at async /var/task/node_modules/next/dist/server/base-server.js:157:99
    at async module.exports (/var/task/apps/web/___next_launcher.cjs:29:9)

@emrysal emrysal requested a review from zomars as a code owner March 27, 2023 21:08
@emrysal emrysal requested a review from a team March 27, 2023 21:08
@vercel
Copy link
Copy Markdown

vercel bot commented Mar 27, 2023

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

Name Status Preview Comments Updated
cal ✅ Ready (Inspect) Visit Preview 💬 Add your feedback Mar 27, 2023 at 9:18PM (UTC)
dhe ❌ Failed (Inspect) Mar 27, 2023 at 9:18PM (UTC)
ui ✅ Ready (Inspect) Visit Preview 💬 Add your feedback Mar 27, 2023 at 9:18PM (UTC)

@github-actions
Copy link
Copy Markdown
Contributor

📦 Next.js Bundle Analysis

This analysis was generated by the next.js bundle analysis action 🤖

🎉 Global Bundle Size Decreased

Page Size (compressed)
global 233.22 KB (-21 B)
Details

The global bundle is the javascript bundle that loads alongside every page. It is in its own category because its impact is much higher - an increase to its size means that every page on your website loads slower, and a decrease means every page loads faster.

Any third party scripts you have added directly to your app using the <script> tag are not accounted for in this analysis

If you want further insight into what is behind the changes, give @next/bundle-analyzer a try!

Sixty-four Pages Changed Size

The following pages changed size from the code in this PR compared to its base branch:

Page Size (compressed) First Load % of Budget (350 KB)
/404 8.36 KB 241.58 KB 69.02% (+/- <0.01%)
/[user] 103.4 KB 336.62 KB 96.18% (+/- <0.01%)
/[user]/[type] 91.85 KB 325.07 KB 92.88% (+/- <0.01%)
/[user]/[type]/embed 91.88 KB 325.1 KB 92.89% (+/- <0.01%)
/[user]/embed 103.47 KB 336.69 KB 96.20% (+/- <0.01%)
/apps 167.18 KB 400.4 KB 114.40% (+/- <0.01%)
/apps/[slug] 190.9 KB 424.12 KB 121.18% (+/- <0.01%)
/apps/[slug]/[...pages] 392.31 KB 625.53 KB 178.72% (+/- <0.01%)
/apps/categories 152.08 KB 385.29 KB 110.08% (🟡 +0.01%)
/apps/categories/[category] 155.94 KB 389.16 KB 111.19% (+/- <0.01%)
/apps/installed/[category] 197.04 KB 430.26 KB 122.93% (+/- <0.01%)
/auth/error 19.24 KB 252.46 KB 72.13% (+/- <0.01%)
/auth/forgot-password 25.63 KB 258.85 KB 73.96% (+/- <0.01%)
/auth/forgot-password/[id] 32.83 KB 266.05 KB 76.01% (+/- <0.01%)
/auth/login 40.1 KB 273.32 KB 78.09% (+/- <0.01%)
/auth/logout 7.56 KB 240.78 KB 68.79% (+/- <0.01%)
/availability 155.28 KB 388.5 KB 111.00% (🟢 -0.03%)
/availability/[schedule] 272.09 KB 505.31 KB 144.37% (🟢 -0.01%)
/availability/troubleshoot 152.76 KB 385.98 KB 110.28% (+/- <0.01%)
/booking/[uid] 123.57 KB 356.79 KB 101.94% (+/- <0.01%)
/bookings/[status] 272.39 KB 505.61 KB 144.46% (+/- <0.01%)
/d/[link]/[slug] 91.5 KB 324.72 KB 92.78% (+/- <0.01%)
/d/[link]/[slug]/embed 91.53 KB 324.75 KB 92.79% (+/- <0.01%)
/event-types 349.31 KB 582.53 KB 166.44% (+/- <0.01%)
/event-types/[type] 382.37 KB 615.59 KB 175.88% (🟢 -0.15%)
/insights 386.24 KB 619.46 KB 176.99% (+/- <0.01%)
/more 151.7 KB 384.92 KB 109.98% (+/- <0.01%)
/settings/admin 157.16 KB 390.38 KB 111.54% (+/- <0.01%)
/settings/admin/apps 165.84 KB 399.06 KB 114.02% (+/- <0.01%)
/settings/admin/apps/[category] 165.83 KB 399.05 KB 114.01% (+/- <0.01%)
/settings/admin/flags 160.05 KB 393.27 KB 112.36% (+/- <0.01%)
/settings/admin/impersonation 157.44 KB 390.66 KB 111.62% (+/- <0.01%)
/settings/billing 157.27 KB 390.49 KB 111.57% (+/- <0.01%)
/settings/developer/api-keys 186.42 KB 419.64 KB 119.90% (+/- <0.01%)
/settings/developer/webhooks 159.76 KB 392.98 KB 112.28% (+/- <0.01%)
/settings/developer/webhooks/[id] 190.61 KB 423.83 KB 121.09% (🟡 +0.01%)
/settings/developer/webhooks/new 190.47 KB 423.69 KB 121.05% (🟡 +0.01%)
/settings/my-account/appearance 171.23 KB 404.45 KB 115.56% (+/- <0.01%)
/settings/my-account/calendars 191.46 KB 424.68 KB 121.34% (+/- <0.01%)
/settings/my-account/conferencing 163.03 KB 396.25 KB 113.21% (🟡 +0.01%)
/settings/my-account/general 266.42 KB 499.64 KB 142.75% (🟡 +0.01%)
/settings/my-account/profile 274.32 KB 507.54 KB 145.01% (+/- <0.01%)
/settings/security/impersonation 159.31 KB 392.53 KB 112.15% (+/- <0.01%)
/settings/security/password 192.6 KB 425.82 KB 121.66% (+/- <0.01%)
/settings/security/sso 167 KB 400.22 KB 114.35% (+/- <0.01%)
/settings/security/two-factor-auth 161.76 KB 394.98 KB 112.85% (+/- <0.01%)
/settings/teams 156.9 KB 390.12 KB 111.46% (+/- <0.01%)
/settings/teams/[id]/appearance 171.26 KB 404.48 KB 115.56% (🟡 +0.01%)
/settings/teams/[id]/billing 157.14 KB 390.36 KB 111.53% (+/- <0.01%)
/settings/teams/[id]/members 297.14 KB 530.36 KB 151.53% (+/- <0.01%)
/settings/teams/[id]/profile 269.53 KB 502.75 KB 143.64% (+/- <0.01%)
/settings/teams/[id]/sso 167.1 KB 400.32 KB 114.38% (+/- <0.01%)
/settings/teams/new 92.73 KB 325.95 KB 93.13% (+/- <0.01%)
/signup 25.5 KB 258.72 KB 73.92% (+/- <0.01%)
/team/[slug] 105.87 KB 339.09 KB 96.88% (+/- <0.01%)
/team/[slug]/[type] 91.5 KB 324.72 KB 92.78% (+/- <0.01%)
/team/[slug]/[type]/embed 91.53 KB 324.75 KB 92.79% (+/- <0.01%)
/team/[slug]/embed 105.94 KB 339.16 KB 96.90% (+/- <0.01%)
/teams 151.92 KB 385.14 KB 110.04% (+/- <0.01%)
/video/meeting-ended/[uid] 14.67 KB 247.88 KB 70.82% (+/- <0.01%)
/video/meeting-not-started/[uid] 14.3 KB 247.52 KB 70.72% (+/- <0.01%)
/video/no-meeting-found 6.6 KB 239.82 KB 68.52% (+/- <0.01%)
/workflows 164.82 KB 398.04 KB 113.72% (🟡 +0.01%)
/workflows/[workflow] 294.01 KB 527.23 KB 150.64% (+/- <0.01%)
Details

Only the gzipped size is provided here based on an expert tip.

First Load is the size of the global bundle plus the bundle for the individual page. If a user were to show up to your website and land on a given page, the first load size represents the amount of javascript that user would need to download. If next/link is used, subsequent page loads would only need to download that page's bundle (the number in the "Size" column), since the global bundle has already been downloaded.

Any third party scripts you have added directly to your app using the <script> tag are not accounted for in this analysis

The "Budget %" column shows what percentage of your performance budget the First Load total takes up. For example, if your budget was 100kb, and a given page's first load size was 10kb, it would be 10% of your budget. You can also see how much this has increased or decreased compared to the base branch of your PR. If this percentage has increased by 20% or more, there will be a red status indicator applied, indicating that special attention should be given to this. If you see "+/- <0.01%" it means that there was a change in bundle size, but it is a trivial enough amount that it can be ignored.

@deploysentinel
Copy link
Copy Markdown

Current Playwright Test Results Summary

✅ 52 Passing - ⚠️ 1 Flaky

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

(Last updated on 03/27/2023 09:29:19pm UTC)

Run Details

Running Workflow PR Update on Github Actions

Commit: 1392a47

Started: 03/27/2023 09:23:24pm UTC

⚠️ Flakes

📄   apps/web/playwright/event-types.e2e.ts • 1 Flake

Test Case Results

Test Case Last 7 days Failures Last 7 days Flakes
Event Types tests user can add multiple organizer address
Retry 1Initial Attempt
3.90% (8) 8 / 205 runs
failed over last 7 days
32.68% (67) 67 / 205 runs
flaked over last 7 days

View Detailed Build Results


@emrysal emrysal merged commit be6cf47 into main Mar 27, 2023
@emrysal emrysal deleted the bugfix/allow-empty-references branch March 27, 2023 22:16
@PeerRich PeerRich added the core area: core, team members only label Jul 24, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

core area: core, team members only

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants