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:

  1. Use MongoDB _id everywhere (breaks human-readable card.column values)
  2. Use slug everywhere (breaks API update/delete calls)
  3. 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


🔗 Related


Auto-generated by MCP Smart Consolidation