Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@sean-brydon
Copy link
Member

@sean-brydon sean-brydon commented Oct 22, 2025

remove the mergeRotuer which after running a tsc trace - appears to be generating some nasty types. In favour of using a seperate router for this

@keithwillcode keithwillcode added consumer core area: core, team members only labels Oct 22, 2025
Comment on lines -56 to -61
eventTypes: mergeRouters(
eventTypesRouter,
router({
heavy: heavyEventTypesRouter,
})
),
Copy link
Member Author

Choose a reason for hiding this comment

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

MergeRouter kills our types when looking at a trace - easier to do this instead

@vercel
Copy link

vercel bot commented Oct 22, 2025

The latest updates on your projects. Learn more about Vercel for GitHub.

2 Skipped Deployments
Project Deployment Preview Comments Updated (UTC)
cal Ignored Ignored Oct 22, 2025 5:04pm
cal-eu Ignored Ignored Oct 22, 2025 5:04pm

// - viewer.me - 2 segment paths like this are for logged in requests
// - viewer.public.i18n - 3 segments paths can be public or authed
// - viewer.eventTypes.heavy.create - 4 segments paths for heavy sub-router
// - viewer.eventTypesHeavy.create - 3 segment paths for flattened heavy router
Copy link
Contributor

Choose a reason for hiding this comment

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

Delete this line. The line above is for 3 segments already

if (parts.length == 2) {
endpoint = parts[0] as keyof typeof links;
path = parts[1];
} else if (parts.length >= 3 && parts[2] === "heavy") {
Copy link
Contributor

Choose a reason for hiding this comment

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

Delete this if. No longer needed

// - viewer.me - 2 segment paths like this are for logged in requests
// - viewer.public.i18n - 3 segments paths can be public or authed
// - viewer.eventTypes.heavy.create - 4 segments paths for heavy sub-router
// - viewer.eventTypesHeavy.create - 3 segment paths for flattened heavy router
Copy link
Contributor

Choose a reason for hiding this comment

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

Delete this line as the 3 segment description above works

@pull-request-size pull-request-size bot added size/M and removed size/S labels Oct 22, 2025
@sean-brydon sean-brydon marked this pull request as ready for review October 22, 2025 11:22
@sean-brydon sean-brydon requested review from a team as code owners October 22, 2025 11:22
@graphite-app graphite-app bot requested a review from a team October 22, 2025 11:22
Copy link
Contributor

@cubic-dev-ai cubic-dev-ai bot left a comment

Choose a reason for hiding this comment

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

1 issue found across 10 files

Prompt for AI agents (all 1 issues)

Understand the root cause of the following 1 issues and fix them.


<file name="packages/trpc/react/trpc.ts">

<violation number="1" location="packages/trpc/react/trpc.ts:30">
The heavy router guard was removed, but ENDPOINTS still exposes only &quot;eventTypes/heavy&quot;, so viewer.eventTypesHeavy.* now resolves to links[&quot;eventTypesHeavy&quot;] === undefined and these tRPC calls will fail at runtime.</violation>
</file>

React with 👍 or 👎 to teach cubic. Mention @cubic-dev-ai to give feedback, ask questions, or re-run the review.

Copy link
Contributor

@cubic-dev-ai cubic-dev-ai bot left a comment

Choose a reason for hiding this comment

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

1 issue found across 10 files

Prompt for AI agents (all 1 issues)

Understand the root cause of the following 1 issues and fix them.


<file name="apps/web/app/_trpc/trpc-client.ts">

<violation number="1" location="apps/web/app/_trpc/trpc-client.ts:26">
Heavy router calls now get sent to the generic eventTypes endpoint instead of /eventTypes/heavy, so operations like viewer.eventTypesHeavy.update will fail.</violation>
</file>

React with 👍 or 👎 to teach cubic. Mention @cubic-dev-ai to give feedback, ask questions, or re-run the review.

Copy link
Contributor

@keithwillcode keithwillcode left a comment

Choose a reason for hiding this comment

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

@sean-brydon Since this is going to now hit /api/trpc/eventTypesHeavy, you need to move that [trpc].ts file in app/web/pages/api/trpc/eventTypes/heavy/[trpc].ts

@github-actions github-actions bot marked this pull request as draft October 22, 2025 12:27
@github-actions
Copy link
Contributor

github-actions bot commented Oct 22, 2025

E2E results are ready!

@sean-brydon sean-brydon marked this pull request as ready for review October 22, 2025 13:45
@graphite-app graphite-app bot requested a review from a team October 22, 2025 13:45
Copy link
Contributor

@cubic-dev-ai cubic-dev-ai bot left a comment

Choose a reason for hiding this comment

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

No issues found across 22 files

Copy link
Contributor

@anikdhabal anikdhabal left a comment

Choose a reason for hiding this comment

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

E2E is failing, and it looks like we are missing that.

anikdhabal and others added 3 commits October 22, 2025 21:33
The WorkflowType enum should be imported from @calcom/prisma/enums
rather than @calcom/prisma/client. This was causing integration tests
to fail with 'Cannot read properties of undefined (reading EVENT_TYPE)'
because the enum wasn't being properly exported from the client.

This fixes the remaining integration test failures after the Prisma 6.16
upgrade.

Co-Authored-By: [email protected] <[email protected]>
@anikdhabal anikdhabal marked this pull request as ready for review October 22, 2025 17:33
Copy link
Contributor

@anikdhabal anikdhabal left a comment

Choose a reason for hiding this comment

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

Looks Good

Copy link
Contributor

@cubic-dev-ai cubic-dev-ai bot left a comment

Choose a reason for hiding this comment

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

No issues found across 23 files

@keithwillcode keithwillcode merged commit ae87fdc into main Oct 23, 2025
41 checks passed
@keithwillcode keithwillcode deleted the perf/remove-merge-router-event-type-heavy branch October 23, 2025 10:32
KartikLabhshetwar pushed a commit to KartikLabhshetwar/cal.com that referenced this pull request Oct 25, 2025
* Rename eventTypes.heavy to eventTypesHeavy

* Update eventTypes lib types

* Remove trpc and trpc client heavy resolve endpoint

* Update shared file

* Fix comments

* Rename path

* Fix wait for URL path

* Fix API endpoint in event-types.e2e.ts test

* fix: Import WorkflowType from enums instead of client

The WorkflowType enum should be imported from @calcom/prisma/enums
rather than @calcom/prisma/client. This was causing integration tests
to fail with 'Cannot read properties of undefined (reading EVENT_TYPE)'
because the enum wasn't being properly exported from the client.

This fixes the remaining integration test failures after the Prisma 6.16
upgrade.

Co-Authored-By: [email protected] <[email protected]>

---------

Co-authored-by: Keith Williams <[email protected]>
Co-authored-by: Anik Dhabal Babu <[email protected]>
Co-authored-by: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
Co-authored-by: [email protected] <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

consumer core area: core, team members only ready-for-e2e size/M

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants