Skip to content

Commit f127eac

Browse files
committed
fix(webapp): await default billing alerts seed to avoid racing user edits
1 parent 4b5fe49 commit f127eac

3 files changed

Lines changed: 5304 additions & 4929 deletions

File tree

apps/webapp/app/models/organization.server.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -129,12 +129,13 @@ export async function createOrganization(
129129
adminUserId: userId,
130130
});
131131

132-
void seedDefaultBillingAlerts(organization.id);
132+
// Awaited so the seed can't land after the user's first alert edit.
133+
await seedDefaultBillingAlerts(organization.id);
133134

134135
return { ...organization };
135136
}
136137

137-
/** Seed default billing alerts for a new org. Never blocks/fails org creation. */
138+
/** Seed default billing alerts for a new org. Never fails org creation. */
138139
async function seedDefaultBillingAlerts(organizationId: string): Promise<void> {
139140
if (!isBillingConfigured()) {
140141
return;

0 commit comments

Comments
 (0)