Skip to content

feat(slots): thread rescheduledBy param from URL through to tRPC input#28909

Open
bcornish1797 wants to merge 1 commit intocalcom:mainfrom
bcornish1797:feat/16378-part-b-rescheduled-by
Open

feat(slots): thread rescheduledBy param from URL through to tRPC input#28909
bcornish1797 wants to merge 1 commit intocalcom:mainfrom
bcornish1797:feat/16378-part-b-rescheduled-by

Conversation

@bcornish1797
Copy link
Copy Markdown

@bcornish1797 bcornish1797 commented Apr 15, 2026

Second of three PRs splitting #28636.

Threads a new rescheduledBy URL param through useScheduleForEvent, useSchedule, and the tRPC getSchedule input. Nothing consumes it yet; Part C (#28911) reads it to decide whether a reschedule is host-initiated. Small additive change, backwards compatible at both the URL and schema levels (nullish).

Split of calcom#28636 (Part B of 3). Plumbing only — adds a new `rescheduledBy`
search param that flows from the URL through `useScheduleForEvent` →
`useSchedule` → the tRPC `getSchedule` input schema. Nothing consumes
the field yet; it will be read by `_getGuestBusyTimesForReschedule` in
Part C to gate guest busy-time blocking on host-initiated reschedules.

Concretely:
- `apps/web/modules/schedules/hooks/useEvent.ts`: reads
  `searchParams.get("rescheduledBy")` alongside the existing
  `rescheduleUid` read and forwards it to `useSchedule`.
- `apps/web/modules/schedules/hooks/useSchedule.ts`: adds
  `rescheduledBy` to `UseScheduleWithCacheArgs` and passes it through
  to the tRPC query input.
- `packages/trpc/server/routers/viewer/slots/types.ts`: adds
  `rescheduledBy: z.string().nullish()` to `getScheduleSchemaObject`.

Backwards compatible — the field is nullish on both the URL and the
schema, so older clients keep working unchanged.
@bcornish1797 bcornish1797 requested a review from a team as a code owner April 15, 2026 14:14
@github-actions
Copy link
Copy Markdown
Contributor

Welcome to Cal.diy, @bcornish1797! Thanks for opening this pull request.

A few things to keep in mind:

  • This is Cal.diy, not Cal.com. Cal.diy is a community-driven, fully open-source fork of Cal.com licensed under MIT. Your changes here will be part of Cal.diy — they will not be deployed to the Cal.com production app.
  • Please review our Contributing Guidelines if you haven't already.
  • Make sure your PR title follows the Conventional Commits format.

A maintainer will review your PR soon. Thanks for contributing!

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai bot commented Apr 15, 2026

📝 Walkthrough

Walkthrough

This change adds support for a rescheduledBy query-string parameter throughout the schedule management system. The parameter is extracted in the useEvent hook, forwarded to the useSchedule hook, and propagated through the API request input to the backend. The getScheduleSchemaObject Zod schema is updated to validate and include the new optional rescheduledBy field, extending the type definitions used by the schedule retrieval logic.

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately summarizes the main change: threading the rescheduledBy parameter from URL through frontend hooks to tRPC input schema.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Description check ✅ Passed The PR description clearly relates to the changeset, explaining the purpose of threading a rescheduledBy parameter through the codebase as part of a three-part feature series.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@CLAassistant
Copy link
Copy Markdown

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.


Bcornish seems not to be a GitHub user. You need a GitHub account to be able to sign the CLA. If you have already a GitHub account, please add the email address used for this commit to your account.
You have signed the CLA already but the status is still pending? Let us recheck it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants