Technical Debt — Tenant Migration Admin Console Gaps
By Engineering Team•October 11, 2026•3 min read
| Metadata | Details |
|---|---|
| System Name | ui-admin-application — Tenant Data Migration feature |
| Document ID | TD-2026-MIG-002 |
| Author | Engineering Team |
| Status | Open |
TD-30 — Client-generated batchId has no collision guard
- Status: Open
- Severity: Medium
- Affected component:
ui-admin-application/src/features/migration/MigrationController.ts:225. - Evidence:
startUploadderives the batch identifier asconst batchId = \batch_${Date.now()}`— a millisecond-resolution timestamp with no random component and no server-side uniqueness check before use. This value is passed directly as bothfileNameIdandtransactionIdtoMediaService.getUploadPresignedUrls, which in turn becomes the Pub/Sub envelope'stransaction_idthattenant-migration'sMigrationBatchCreatedReceiveruses, together with(tenant_id, service_name, transaction_name)`, as its idempotency key for batch creation (see SR-029 FR-02 and Architecture-00024 step 3). - Impact: Two uploads issued within the same millisecond — most plausibly two browser tabs/sessions for the same tenant, or a double-click that isn’t otherwise debounced — would generate the identical
batchId. Because batch creation is explicitly idempotent on this key, the second upload’s batch-creation event would silently no-op: the second file is uploaded to storage but never gets its ownmigration_batchesdocument, and the operator sees no error — only a batch that “went missing” duringpollForBatch’s wait, surfacing as the generic 60-second timeout error rather than a clear “this batch ID is already in use” message. - Remediation direction: Replace the timestamp with a client-generated UUID (
crypto.randomUUID(), already used elsewhere in this app forX-Correlation-IDgeneration perui-admin-application/CLAUDE.md’s OTel section) — collision-proof at the scale this console operates at, with no server-side change needed. - Related requirement: SR-030 FR-02.
TD-31 — MigrationRepository.ts has no DEV_MOCK_* fallback
- Status: Open
- Severity: Low
- Affected component:
ui-admin-application/src/features/migration/MigrationRepository.ts. - Evidence:
ui-admin-application/CLAUDE.md’s Rules for Code Generation, item 8, states: “All new features must include DEV mock data in the repository’s fetch function so the UI works without a running backend.” A direct search ofMigrationRepository.tsforDEV_MOCKreturns zero matches — every one of its nine REST calls and the SSE stream opener go straight toapiClient/openEventStreamwith noif (import.meta.env.DEV) return DEV_MOCK_*branch, unlike every other documented feature in this admin app. - Impact: The Tenant Data Migration console cannot be exercised in local frontend-only development —
npm run devwith notenant-migrationbackend running leaves every tab showing a load error instead of representative mock data, which every other feature in this codebase avoids by design. - Remediation direction: Add
DEV_MOCK_BATCHES/DEV_MOCK_BATCH/DEV_MOCK_BATCH_ERRORSconstants (shaped as representativeMigrationBatch/BatchErrorsResultvalues, covering at least one of each terminal status) and the standardif (import.meta.env.DEV) return ...guard in each fetch function, following the same pattern already used elsewhere in this app (seefeatures/category/CategoryRepository.tsfor the canonical shape).openMigrationStream’s SSE path has no existing precedent for a DEV-mock equivalent in this codebase and needs its own call before assuming one — flagged here rather than assumed. - Related requirement: SR-030 NFR-05.
TD-32 — Entity-type names shown raw, unlike stage names
- Status: Open
- Severity: Low
- Affected component:
ui-admin-application/src/features/migration/MigrationService.ts. - Evidence:
stageLabel/STAGE_LABELShumanizes each of the four fixed stage buckets (“Stage 1 — Foundational”, etc.) for display. No equivalent mapping exists for entity-type names:stageEntityRowsandentitySummaryRowsboth pass throughentityType/Object.keys/Object.valuesusing the raw backend enum string (e.g.PRODUCT_OPENING_ENTRY_PROCESS,PRODUCT_SPECIFICATION) with no humanizing function applied anywhere in this file or inMonitorPage.tsx/AuditDrawer.tsx. - Impact: Minor — purely cosmetic, visible directly in the
02_live_monitor.pngand03_historical_audit_02_view.pngscreenshots, where every entity-type row/card label reads as a raw backend constant rather than the same plain-language labels the stage headers already get. Doesn’t block any workflow, but is inconsistent with the humanization already done one level up. - Remediation direction: Add an
entityTypeLabel(entityType: string): stringfunction toMigrationService.ts, following the sameRecord<string, string>lookup pattern asSTAGE_LABELS, and apply it at the same two call sites (MonitorPage.tsx’s stage-row rendering,AuditDrawer.tsx’s entity summary cards) that currently renderentityTypedirectly. - Related requirement: SR-030 FR-09, FR-17.
Related Documents
- BRD-029 — Admin UI: Tenant Catalog Migration Console
- SR-030 — Admin UI: Tenant Catalog Migration Console Spec
- ADR-00046 — Tabs and Dual-Channel Status Strategy for the Tenant Migration Console
- Architecture-00025 — Tenant Migration Admin Console Component Topology and Data Flow
- TD-00023 — Tenant Catalog Bulk Migration Gaps
- Tenant Data Migration Admin UI — Walkthrough Overview