fix: check team existence before parsing metadata#29466
Conversation
…pp (calcom#29457) teamMetadataSchema.parse(team?.metadata) was called before checking if team exists, causing a Zod validation error on undefined instead of the intended NotFoundException. Also corrected the misleading error message from 'user not found' to 'team not found'.
|
Welcome to Cal.diy, @pranavv00! Thanks for opening this pull request. A few things to keep in mind:
A maintainer will review your PR soon. Thanks for contributing! |
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
📝 WalkthroughWalkthroughThis pull request fixes the 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Warning There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure. 🔧 ESLint
ESLint skipped: no ESLint configuration detected in root package.json. To enable, add 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. Comment |
|
This PR has been marked as stale due to inactivity. If you're still working on it or need any help, please let us know or update the PR to keep it active. |
Summary
Fixes #29457 by checking whether the team exists before parsing metadata.
Changes
if (!team)check before metadata parsing"user not found"to"team not found"Result
Nonexistent teams now correctly throw a
NotFoundExceptioninstead of a schema validation error.