Bugfix: Why did kanban board/column structural changes not persist t...
Documentation for Sessions
🐛 Bugfix: Why did kanban board/column structural changes not persist t...
Date: 2026-03-26
Time: 15:19:14 UTC
Session: gspace1-271.3
Agent: angular
Confidence: 95%
Status: ✅ Documented
📋 Decision Context
Question:
Why did kanban board/column structural changes not persist to MongoDB across page refreshes?
Task: Not specified
🎯 Decision Made
Chosen:
Three root causes fixed: (1) Board/column update API calls used slug as record ID but backend expects MongoDB _id — added _dbId field to track both. (2) Card create sent client-side temp ID to MongoDB — stripped id from payload, replaced with _id from response. (3) Boards and columns had no entity backing — added board-entity and column-entity @Input attributes with full CRUD persistence.
Options Considered:
- Use MongoDB _id everywhere (breaks human-readable card.column values)
- Use slug everywhere (breaks API update/delete calls)
- Track both slug and _dbId (chosen — clean separation of concerns)
💭 Reasoning
The kanban widget initially stored boards/columns as pure in-memory signals from HTML attributes. Cards were partially persisting but with wrong references. The slug vs _id mismatch was the subtlest bug: DataClient.update() calls PUT /api/.../KanbanBoard/{id} where {id} must be the MongoDB ObjectId, not the human-readable slug. Solution: every Board and Column stores both id (slug, for card references) and _dbId (MongoDB _id, for API calls). Cards reference slugs, API calls use _dbIds.
📁 Files Involved
libs/libs-structural/platform-elements-angular/src/lib/models/kanban.models.tslibs/libs-structural/platform-elements-angular/src/lib/components/kanban-widget/kanban-widget.component.tslibs/libs-structural/platform-elements-angular/src/lib/utils/pe-data-bridge.ts
🔗 Related
- Decision ID:
dev_1774538354049_9ons5oy - Session: 271
- Workspace: gspace1
Auto-generated by MCP Smart Consolidation