[OPTIMIZATION] Settings Page - CSV/Contacts Import N+1 - src/pages/Settings.tsx #56

Closed
opened 2026-06-06 20:42:12 +00:00 by Mark · 0 comments
Owner

Critical Issues (2)

  1. CSV import: for (const row of imported) { await addPerson(...) } - N+1 inserts

    • Fix: Build array, use db.people.bulkAdd(contactsArray)
    • Impact: 10-50x faster bulk import
  2. Native contacts import: Same N+1 pattern in for (const contact of contactsToImport)

    • Fix: Batch with bulkAdd in chunks of 50

High Issues (1)

  1. Sequential native contact processing - batch with Promise.all chunks

Medium Issues (2)

  1. Duplicate filter logic ×3 (call/sms/email previews) - extract shared useCallback
  2. FileReader missing onerror handlers (2 instances) - add error rejection

Low Issues (1)

  1. 68 inline style={{}} objects - move to Tailwind classes
## Critical Issues (2) 1. **CSV import**: `for (const row of imported) { await addPerson(...) }` - N+1 inserts - Fix: Build array, use `db.people.bulkAdd(contactsArray)` - Impact: 10-50x faster bulk import 2. **Native contacts import**: Same N+1 pattern in `for (const contact of contactsToImport)` - Fix: Batch with `bulkAdd` in chunks of 50 ## High Issues (1) 3. **Sequential native contact processing** - batch with `Promise.all` chunks ## Medium Issues (2) 4. **Duplicate filter logic** ×3 (call/sms/email previews) - extract shared `useCallback` 5. **FileReader missing `onerror` handlers** (2 instances) - add error rejection ## Low Issues (1) 6. **68 inline `style={{}}` objects** - move to Tailwind classes
Mark 2026-06-14 12:53:45 +00:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
Mark/kimi_agent_kin_app_sync#56
No description provided.