fix: provisioning race condition and noisy ClickHouse logs
Defer provisionAsync() until after the transaction commits using TransactionSynchronization.afterCommit(). Previously the @Async thread raced the @Transactional commit — findById returned null because the tenant INSERT wasn't visible yet. Downgrade ClickHouse UNKNOWN_TABLE errors to DEBUG level in InfrastructureService. These are expected on fresh installs before any cameleer-server has created the tables. Make the onboarding slug field read-only (derived from org name). Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
import { useState, useEffect } from 'react';
|
||||
import { useState } from 'react';
|
||||
import { Card, Input, Button, FormField, Alert } from '@cameleer/design-system';
|
||||
import cameleerLogo from '@cameleer/design-system/assets/cameleer-logo.svg';
|
||||
import { api } from '../api/client';
|
||||
@@ -14,16 +14,10 @@ interface TenantResponse {
|
||||
|
||||
export function OnboardingPage() {
|
||||
const [name, setName] = useState('');
|
||||
const [slug, setSlug] = useState('');
|
||||
const [slugTouched, setSlugTouched] = useState(false);
|
||||
const [loading, setLoading] = useState(false);
|
||||
const [error, setError] = useState<string | null>(null);
|
||||
|
||||
useEffect(() => {
|
||||
if (!slugTouched) {
|
||||
setSlug(toSlug(name));
|
||||
}
|
||||
}, [name, slugTouched]);
|
||||
const slug = toSlug(name);
|
||||
|
||||
async function handleSubmit(e: React.FormEvent) {
|
||||
e.preventDefault();
|
||||
@@ -78,10 +72,8 @@ export function OnboardingPage() {
|
||||
<Input
|
||||
id="onboard-slug"
|
||||
value={slug}
|
||||
onChange={(e) => { setSlugTouched(true); setSlug(e.target.value); }}
|
||||
placeholder="acme-corp"
|
||||
disabled={loading}
|
||||
required
|
||||
readOnly
|
||||
/>
|
||||
</FormField>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user