Skip to content

Commit 19dbde8

Browse files
Add comment (calcom#21920)
1 parent a5fe101 commit 19dbde8

1 file changed

Lines changed: 3 additions & 0 deletions

File tree

packages/features/ee/organizations/lib/server/createOrganizationFromOnboarding.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -197,6 +197,9 @@ async function createOrganizationWithNonExistentUserAsOwner({
197197
);
198198
const owner = await findUserToBeOrgOwner(email);
199199
if (!owner) {
200+
// Can happen when the organization was created earlier and the webhook had failed and when the webhook got fired again in next subscription update, then the email was deleted already
201+
// The fix would be to change the email in Onboarding record to new owner of the organization
202+
// TODO: Identify the owner of the organization from Membership table and use that email instead here.
200203
throw new Error(`Org exists but owner could not be found for email: ${email}`);
201204
}
202205
return { organization, owner };

0 commit comments

Comments
 (0)