Skip to content

fix(app-store): preserve delegation fields on user path of getLocationGroupedOptions (#29898) - #30094

Open
Aj2280 wants to merge 1 commit into
calcom:mainfrom
Aj2280:fix/preserve-delegation-fields-user-path
Open

fix(app-store): preserve delegation fields on user path of getLocationGroupedOptions (#29898)#30094
Aj2280 wants to merge 1 commit into
calcom:mainfrom
Aj2280:fix/preserve-delegation-fields-user-path

Conversation

@Aj2280

@Aj2280 Aj2280 commented Sep 3, 2026

Copy link
Copy Markdown

Description

PR #29724 moved the credential query out of getLocationGroupedOptions into PrismaCredentialRepository.findNonDelegationCredentialsByAppCategories. However, it also moved buildNonDelegationCredentials inside the repository method, which unconditionally nulled delegation fields on all returned credentials.

This caused the user branch of getLocationGroupedOptions to also receive nulled delegation fields before calling enrichUserWithDelegationConferencingCredentialsWithoutOrgId.

This PR:

  • Preserves delegation fields in PrismaCredentialRepository.findNonDelegationCredentialsByAppCategories as stored.
  • Applies buildNonDelegationCredentials only on the non-user (team/org) branch of getLocationGroupedOptions.
  • Adds unit tests for PrismaCredentialRepository and getLocationGroupedOptions.

Fixes: #29898

…nGroupedOptions (calcom#29898)

- Remove premature buildNonDelegationCredentials call inside PrismaCredentialRepository.findNonDelegationCredentialsByAppCategories
- Explicitly apply buildNonDelegationCredentials only on the non-user (team) branch of getLocationGroupedOptions
- Add unit tests for PrismaCredentialRepository and getLocationGroupedOptions

fixes: calcom#29898
@github-actions

github-actions Bot commented Sep 3, 2026

Copy link
Copy Markdown
Contributor

Welcome to Cal.diy, @Aj2280! 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 3, 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: 479a418e-6bad-4069-916b-c31837b3e333

📥 Commits

Reviewing files that changed from the base of the PR and between e70486c and 65a8fa8.

📒 Files selected for processing (4)
  • packages/app-store/repositories/PrismaCredentialRepository.test.ts
  • packages/app-store/repositories/PrismaCredentialRepository.ts
  • packages/app-store/server.test.ts
  • packages/app-store/server.ts

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


📝 Walkthrough

Walkthrough

The repository now returns raw credential rows so delegationCredentialId remains available for user-path enrichment. The team path applies buildNonDelegationCredentials before enabled-app lookup. New tests cover the Prisma query, delegation-field preservation, user enrichment, and team credential normalization.

Merge Risk: ⚪ Minimal · up to 65a8f

Delegated user credentials retain their linkage for enrichment, while team and organization credentials continue to be normalized before app lookup. The change is covered for both paths and is ready to merge.

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 1 functions across 4 files. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Linked Issues check ✅ Passed The changes satisfy issue #29898 by preserving delegation fields for the user path, applying buildNonDelegationCredentials only to the team/org path, and adding regression coverage.
Out of Scope Changes check ✅ Passed The implementation and tests are directly related to the delegation-field regression described in issue #29898. No unrelated changes are evident.
Title check ✅ Passed The title clearly identifies the app-store fix and the affected user path. It accurately summarizes the main change.
Description check ✅ Passed The description directly explains the delegation-field regression, the branch-specific fix, and the added unit tests.
  • Fix all pre-merge checks with AI
✨ 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.

@CLAassistant

CLAassistant commented Sep 3, 2026

Copy link
Copy Markdown

CLA assistant check
All committers have signed the CLA.

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.

[bug]: PR #29724 widened delegation-field nulling to the user branch of getLocationGroupedOptions

2 participants