cal.com
cal.com copied to clipboard
fix: hydration error in [org-slug]/[team-slug], [org-slug]/[team-slug]/[type] pages
What does this PR do?
- Fixes #17575
- Fixes CAL-XXXX (Linear issue number - should be visible at the bottom of the GitHub issue description)
fixes hydration error due to nested anchor elements.
Before Fix / Issue : https://www.loom.com/share/20d314a3952c47a4a53b252a5eb79edc?sid=a145ef5f-d97a-4d34-8cc7-882e8a91b05c
After Fix : https://www.loom.com/share/c72b274adc8441c498d2a8165dc478db?sid=bcc7d554-328b-4bb0-adcd-76e2ff626dd9
Mandatory Tasks (DO NOT REMOVE)
- [x] I have self-reviewed the code (A decent size PR without self-review might be rejected).
- [x] - N/A -I have updated the developer docs in /docs if this PR makes changes that would require a documentation change. If N/A, write N/A here and check the checkbox.
- [x] I confirm automated tests are in place that prove my fix is effective or that my feature works.
@vijayraghav-io is attempting to deploy a commit to the cal Team on Vercel.
A member of the Team first needs to authorize it.
Graphite Automations
"Add consumer team as reviewer" took an action on this PR โข (11/11/24)
1 reviewer was added to this PR based on Keith Williams's automation.
"Add community label" took an action on this PR โข (11/11/24)
1 label was added to this PR based on Keith Williams's automation.
Ready!
Hey @vijayraghav-io can you please attach a loom video of the fix.
Hey @vijayraghav-io can you please attach a loom video of the fix.
Attached before and after fix videos in description.
This PR is being marked as stale due to inactivity.
Gentle Reminder!
This PR is being marked as stale due to inactivity.
Gentle Reminder! for review
Hey @vijayraghav-io, can you pls resolve merge conflicts? A test seems to be failing. Can you pls address that as well?
Hey @vijayraghav-io, can you pls resolve merge conflicts? A test seems to be failing. Can you pls address that as well?
Sure will check and update
Walkthrough
The changes refactor navigation within the EventTypes and SubTeams components in apps/web/modules/team/team-view.tsx, replacing Link components with clickable list items that use router.push for navigation. Query parameters are now explicitly serialized, and accessibility attributes are added to interactive elements. A new Playwright end-to-end test is introduced in apps/web/playwright/organization/organization-team-page.e2e.ts to verify navigation and booking flows on the organization team page. A minor stylistic change is made in packages/features/schedules/components/Schedule.tsx by removing an extraneous blank line.
Estimated code review effort
๐ฏ 3 (Moderate) | โฑ๏ธ ~15 minutes
Assessment against linked issues
| Objective | Addressed | Explanation |
|---|---|---|
| Eliminate hydration errors on [org-slug]/[team-slug] or [org-slug] pages (#17575) | โ | |
| Eliminate hydration errors on [org-slug/[team-slug]/[event-slug] pages (#17575) | โ | |
| Ensure navigation and booking flows work on org/team pages (#17575) | โ |
Assessment against linked issues: Out-of-scope changes
No out-of-scope changes were found. All changes align with the requirements of the linked issue.
[!NOTE]
โก๏ธ Unit Test Generation is now available in beta!
Learn more here, or try it out under "Finishing Touches" below.
๐ Recent review details
Configuration used: CodeRabbit UI Review profile: CHILL Plan: Pro
๐ฅ Commits
Reviewing files that changed from the base of the PR and between ab9949814aefdcafa2eba4af2fa365fe39e5320b and fba01eb5011ddd20146ef6f05a2c450f115231ee.
๐ Files selected for processing (1)
apps/web/playwright/organization/organization-team-page.e2e.ts(1 hunks)
๐ง Files skipped from review as they are similar to previous changes (1)
- apps/web/playwright/organization/organization-team-page.e2e.ts
โจ Finishing Touches
- [ ] ๐ Generate Docstrings
๐งช Generate unit tests
- [ ] Create PR with unit tests
- [ ] Post copyable unit tests in a comment
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.
๐ชง Tips
Chat
There are 3 ways to chat with CodeRabbit:
- Review comments: Directly reply to a review comment made by CodeRabbit. Example:
I pushed a fix in commit <commit_id>, please review it.Explain this complex logic.Open a follow-up GitHub issue for this discussion.
- Files and specific lines of code (under the "Files changed" tab): Tag
@coderabbitaiin a new review comment at the desired location with your query. Examples:@coderabbitai explain this code block.@coderabbitai modularize this function.
- PR comments: Tag
@coderabbitaiin a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:@coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.@coderabbitai read src/utils.ts and explain its main purpose.@coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.@coderabbitai help me debug CodeRabbit configuration file.
Support
Need help? Create a ticket on our support page for assistance with any issues or questions.
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.
CodeRabbit Commands (Invoked using PR comments)
@coderabbitai pauseto pause the reviews on a PR.@coderabbitai resumeto resume the paused reviews.@coderabbitai reviewto trigger an incremental review. This is useful when automatic reviews are disabled for the repository.@coderabbitai full reviewto do a full review from scratch and review all the files again.@coderabbitai summaryto regenerate the summary of the PR.@coderabbitai generate docstringsto generate docstrings for this PR.@coderabbitai generate sequence diagramto generate a sequence diagram of the changes in this PR.@coderabbitai generate unit teststo generate unit tests for this PR.@coderabbitai resolveresolve all the CodeRabbit review comments.@coderabbitai configurationto show the current CodeRabbit configuration for the repository.@coderabbitai helpto get help.
Other keywords and placeholders
- Add
@coderabbitai ignoreanywhere in the PR description to prevent this PR from being reviewed. - Add
@coderabbitai summaryto generate the high-level summary at a specific location in the PR description. - Add
@coderabbitaianywhere in the PR title to generate the title automatically.
CodeRabbit Configuration File (.coderabbit.yaml)
- You can programmatically configure CodeRabbit by adding a
.coderabbit.yamlfile to the root of your repository. - Please see the configuration documentation for more information.
- If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation:
# yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json
Documentation and Community
- Visit our Documentation for detailed information on how to use CodeRabbit.
- Join our Discord Community to get help, request features, and share feedback.
- Follow us on X/Twitter for updates and announcements.
@coderabbitai review
โ Actions performed
Review triggered.
Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.
Hey @vijayraghav-io, can you pls resolve merge conflicts? A test seems to be failing. Can you pls address that as well?
@kart1ka All tests are passing now. The flaky failing test was a unrelated one. Also removed the flakiness in new test in this PR.
@vijayraghav-io Hey, I apologize for a late response and thanks for opening this PR. I agree that we have a hydration error due to nested anchor elements in the team page. The following is my analysis:
UserAvatarGroup computes hrefs on render using getBookerBaseUrlSync(user.profile?.organization?.slug).
->
That calls getOrgFullOrigin, which depends on env-derived constants like WEBAPP_URL/WEBSITE_URL
->
Hence, the server-rendered values differ from the client-rendered ones during hydration.
So, this issue must be addressed from the component UserAvatarGroup itself, not from team-view. I will address this myself in a separate PR.