Async tenant provisioning (frontend UX) #52

Closed
opened 2026-04-10 09:55:57 +02:00 by claude · 1 comment
Owner

Problem

Tenant provisioning is synchronous — the Create Tenant button blocks for ~30-60s while the backend provisions Docker containers, waits for health checks, pushes license and OIDC config.

Expected

  • Show a "Provisioning..." spinner/progress indicator immediately
  • Navigate to the tenant detail page with status=PROVISIONING
  • Poll for status changes (PROVISIONING → ACTIVE)
  • Toast notification when provisioning completes

Current behavior

The Create Tenant form hangs with no feedback until provisioning completes, then redirects to the detail page.

Scope

Frontend-only change. Backend already sets status=PROVISIONING before provisioning and updates to ACTIVE on success.

## Problem Tenant provisioning is synchronous — the Create Tenant button blocks for ~30-60s while the backend provisions Docker containers, waits for health checks, pushes license and OIDC config. ## Expected - Show a "Provisioning..." spinner/progress indicator immediately - Navigate to the tenant detail page with status=PROVISIONING - Poll for status changes (PROVISIONING → ACTIVE) - Toast notification when provisioning completes ## Current behavior The Create Tenant form hangs with no feedback until provisioning completes, then redirects to the detail page. ## Scope Frontend-only change. Backend already sets status=PROVISIONING before provisioning and updates to ACTIVE on success.
Author
Owner

Fixed in 252c18b.

Backend: Extracted Docker provisioning (containers, health check, license push, OIDC config) into an @Async method. The API now returns immediately after creating the tenant record (PROVISIONING), Logto org, admin user, and license. Provisioning runs in a background thread and updates status to ACTIVE on success or sets provisionError on failure.

Frontend:

  • CreateTenantPage navigates to detail page immediately with "provisioning in progress" toast
  • TenantDetailPage polls every 3s while status=PROVISIONING (via refetchInterval callback)
  • Shows spinner + "Provisioning..." indicator next to status badge
  • Toast notification when provisioning completes (success or warning)
  • VendorTenantsPage list already had 30s refetch, so it picks up status changes too
Fixed in `252c18b`. **Backend**: Extracted Docker provisioning (containers, health check, license push, OIDC config) into an `@Async` method. The API now returns immediately after creating the tenant record (PROVISIONING), Logto org, admin user, and license. Provisioning runs in a background thread and updates status to ACTIVE on success or sets `provisionError` on failure. **Frontend**: - CreateTenantPage navigates to detail page immediately with "provisioning in progress" toast - TenantDetailPage polls every 3s while status=PROVISIONING (via `refetchInterval` callback) - Shows spinner + "Provisioning..." indicator next to status badge - Toast notification when provisioning completes (success or warning) - VendorTenantsPage list already had 30s refetch, so it picks up status changes too
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: cameleer/cameleer-saas#52