Skip to content

fix(trpc): use transaction client tx for tempOrgRedirect and team in updateUser (fixes #30085) - #30090

Open
Ranjeet2063 wants to merge 1 commit into
calcom:mainfrom
Ranjeet2063:fix/updateuser-tx-temp-org-redirect
Open

fix(trpc): use transaction client tx for tempOrgRedirect and team in updateUser (fixes #30085)#30090
Ranjeet2063 wants to merge 1 commit into
calcom:mainfrom
Ranjeet2063:fix/updateuser-tx-temp-org-redirect

Conversation

@Ranjeet2063

Copy link
Copy Markdown

Summary & Problem Statement

Changes Made

  • Updated :
    • Changed to
    • Changed to

Verification

  • Both queries now execute within the transactional boundary (), ensuring complete ACID atomicity and rollback safety during user renames.

Copilot AI lite review requested due to automatic review settings September 2, 2026 12:42

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@github-actions

github-actions Bot commented Sep 2, 2026

Copy link
Copy Markdown
Contributor

Welcome to Cal.diy, @Ranjeet2063! 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

coderabbitai Bot commented Sep 2, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Team

Run ID: eaf604fe-dfa5-415c-a217-d2486cfb8b47

📥 Commits

Reviewing files that changed from the base of the PR and between e70486c and 3ffb226.

📒 Files selected for processing (1)
  • packages/trpc/server/routers/viewer/users/_router.ts

Included review availability: Your plan provides up to 10 included reviews per hour; 9 remain after this review.


📝 Walkthrough

Walkthrough

The admin update mutation now uses the transaction client for the team slug lookup and the tempOrgRedirect.updateMany operation. Both operations execute inside the surrounding $transaction callback.

Merge Risk: ⚪ Minimal · up to 3ffb2

This change keeps user, profile, team, and temporary redirect updates within the same transaction, preventing redirects from being committed when a rename is rolled back. No actionable merge-blocking risk remains beyond normal checks and review.

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly identifies the transaction-client changes for tempOrgRedirect and team in updateUser and references the linked issue.
Description check ✅ Passed The description explains the transaction consistency problem, the two client changes, and the expected rollback behavior. It is directly related to the changeset.
Linked Issues check ✅ Passed The changes satisfy issue #30085 by using tx for both team.findUnique and tempOrgRedirect.updateMany inside the interactive transaction. This keeps redirect updates within the same atomic boundary as …
Out of Scope Changes check ✅ Passed The two-line change is limited to the transaction-client corrections required by issue #30085. No unrelated changes are present.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff. Analyzed 0 functions across 1…
Full details: Linked Issues check

Explanation

The changes satisfy issue #30085 by using tx for both team.findUnique and tempOrgRedirect.updateMany inside the interactive transaction. This keeps redirect updates within the same atomic boundary as the username changes.

Full details: Docstring Coverage

Explanation

No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff. Analyzed 0 functions across 1 files.

✨ Finishing Touches 💡 1
🛠️ Fix failing CI checks 💡
  • Create stacked PR
  • Commit on current branch
🧪 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.

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.

updateUser writes tempOrgRedirect on the outer client inside a $transaction, so the redirect rewrite is not rolled back with the rename

2 participants