Levandor CRM - Debugging Log
Purpose
Past bugs, their root causes, and resolutions for the Levandor CRM project.
Kanban DnD Cursor Offset (2026-03-09)
Symptom: Dragging kanban cards offset from cursor, invalid drops.
Root cause (3 compounding issues):
CSS.Transform.toString(transform)includesscaleX(1) scaleY(1)causing visual offset- Droppable
refon<ScrollArea>(Radix) - ref goes to Root but content scrolls in nested Viewport - Original card visible during drag (opacity-60) alongside DragOverlay
Fix:
- Use
CSS.Translate.toString(transform)instead - Put ref on plain
<div>wrapper around ScrollArea - Set
opacity: 0on sortable wrapper whenisDragging
Day Planner Uncancel Not Working (2026-03-09)
Symptom: Could cancel blocks but couldn’t restore them. Root cause: Toolbar always showed Play/Check/Cancel regardless of status. No restore action existed. Fix: When CANCELLED or DONE, replace with Restore button (Undo2 icon) → sets status=PLANNED, clears actual_start/actual_end.
CI TypeScript Build Failures (2026-03-09)
Symptom: tsc -b in CI failed with 14 errors, local tsc --noEmit passed.
Root cause: tsc -b (project build mode) stricter about cross-project type resolution:
packages/sharedmissing@types/reactdevDependency- Supabase
.then()destructuring → implicitanyunder noImplicitAny Mapconstructor without generics →Map<unknown, unknown>- Stale code referencing removed columns (
is_closed,description)
Fix: Add @types/react to shared, use await instead of .then(), add Map generics, fix stale refs.
Lesson: Always verify with cd web && npx tsc -b before pushing.
pnpm Lockfile Out of Sync (2026-03-09)
Symptom: CI --frozen-lockfile failed.
Root cause: Lockfile changes from adding workspaces weren’t committed.
Fix: Commit the lockfile.
Billingo Vendor Bill Sync - Null Fields (2026-03-11)
Symptom: Vendor bills synced from Billingo API had null vendor_name, total_gross, spending_date.
Root cause: Wrong assumptions about API response structure:
| Code assumed | API actually returns |
|---|---|
spending.name | spending.partner?.name |
spending.gross_price | spending.total_gross |
spending.spending_date | spending.fulfillment_date |
spending.payment_status | spending.paid_at (date, derive status) |
Fix chain (5 edge function deployments):
- v3: Corrected
BillingoSpendinginterface + field mappings +deriveStatus() - v4: Disabled JWT for testing → 157/163 bills created correctly
- DB:
total_grossINTEGER → NUMERIC (API returns decimals) - DB: Added
VENDOR_BILLtobudget_transaction_source_checkconstraint - DB: Filter out zero-amount bills before budget transaction creation
- v5: Re-enabled JWT, removed debug code → production
Result: 163/163 vendor bills, 100% field population, zero nulls.
Lesson: Always inspect actual API responses with debug logging before writing TypeScript interfaces.
Related
- levandor-crm - Project overview
- budget - Budget system (where most bugs surface)