cal.com icon indicating copy to clipboard operation
cal.com copied to clipboard

fix: hydration error in [org-slug]/[team-slug], [org-slug]/[team-slug]/[type] pages

Open vijayraghav-io opened this issue 1 year ago โ€ข 9 comments

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 avatar Nov 11 '24 08:11 vijayraghav-io

@vijayraghav-io is attempting to deploy a commit to the cal Team on Vercel.

A member of the Team first needs to authorize it.

vercel[bot] avatar Nov 11 '24 08:11 vercel[bot]

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.

graphite-app[bot] avatar Nov 11 '24 08:11 graphite-app[bot]

Ready!

vijayraghav-io avatar Nov 11 '24 09:11 vijayraghav-io

Hey @vijayraghav-io can you please attach a loom video of the fix.

Praashh avatar Nov 19 '24 15:11 Praashh

Hey @vijayraghav-io can you please attach a loom video of the fix.

Attached before and after fix videos in description.

vijayraghav-io avatar Nov 19 '24 18:11 vijayraghav-io

This PR is being marked as stale due to inactivity.

github-actions[bot] avatar Dec 06 '24 00:12 github-actions[bot]

Gentle Reminder!

vijayraghav-io avatar Dec 06 '24 13:12 vijayraghav-io

This PR is being marked as stale due to inactivity.

github-actions[bot] avatar Dec 30 '24 00:12 github-actions[bot]

Gentle Reminder! for review

vijayraghav-io avatar Dec 30 '24 08:12 vijayraghav-io

E2E results are ready!

github-actions[bot] avatar Jul 14 '25 05:07 github-actions[bot]

Hey @vijayraghav-io, can you pls resolve merge conflicts? A test seems to be failing. Can you pls address that as well?

kart1ka avatar Jul 14 '25 17:07 kart1ka

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

vijayraghav-io avatar Jul 15 '25 03:07 vijayraghav-io

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.

โค๏ธ Share
๐Ÿชง 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 @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai explain this code block.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in 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 pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR.
  • @coderabbitai generate sequence diagram to generate a sequence diagram of the changes in this PR.
  • @coderabbitai generate unit tests to generate unit tests for this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file 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[bot] avatar Jul 16 '25 08:07 coderabbitai[bot]

@coderabbitai review

vijayraghav-io avatar Jul 16 '25 08:07 vijayraghav-io

โœ… 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.

coderabbitai[bot] avatar Jul 16 '25 08:07 coderabbitai[bot]

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 avatar Jul 28 '25 17:07 vijayraghav-io

@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.

hbjORbj avatar Aug 28 '25 12:08 hbjORbj