Commit b7fda31
authored
fix: Issues observed when inviting members to organization either through teams migration during onboarding or explicit user invite (calcom#22901)
* fix: make team migrations sequential to avoid race conditions
Instead of processing team migrations in parallel using Promise.all,
process them sequentially to avoid race conditions when creating
profiles and memberships for team members.
This simplifies the implementation and avoids the need for complex
retry logic or database-level concurrency controls.
* Promise.all accepts an array of promises and not an array with array in it as the first item. This fixes the issue where these promises were unhandled
* Fix the issue where an existing pending membership with team stays pending even though theorganization membership gets created as accepted1 parent 94a04f0 commit b7fda31
5 files changed
Lines changed: 533 additions & 22 deletions
File tree
- packages/trpc/server/routers/viewer
- organizations
- teams/inviteMember
Lines changed: 12 additions & 15 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
95 | 95 | | |
96 | 96 | | |
97 | 97 | | |
98 | | - | |
99 | | - | |
100 | | - | |
101 | | - | |
102 | | - | |
103 | | - | |
104 | | - | |
105 | | - | |
106 | | - | |
107 | | - | |
108 | | - | |
109 | | - | |
110 | | - | |
111 | | - | |
112 | | - | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
113 | 110 | | |
114 | 111 | | |
115 | 112 | | |
| |||
0 commit comments