Repository navigation
Closed
Labels
Description
Problem
A knowledge entry's Edit dialog opened from the row menu closes, and loses the draft, when someone else saves that entry. The dialog was built to keep the draft and warn instead, but from this entry point it never gets the chance. Paths at main 4cde0834a, under services/platform/.
- A save creates a new row id. Editing adds a new version, which becomes the current entry (
backend/domains/knowledge_entries/spec.md, KENTRY-R3). The list shows the new version under its new_id. - Rows are keyed by
_id. The table gets its row ids fromuseListPage, which defaults torow._id(packages/ui/src/hooks/use-list-page.ts:489-499).DataTablerenders<Fragment key={row.id}>(packages/ui/src/components/data-table/data-table.tsx:1088). When the list next refreshes after another member's save, the old row unmounts and a new one mounts. - The dialog lives inside the row.
app/features/knowledge-entries/components/knowledge-entry-row-actions.tsx:73-80rendersKnowledgeEntryEditDialoginside the row's actions cell, so it unmounts with the row. The unsaved topic and content are dropped, and so is theconfirmDiscardOnDirtyguard. - The designed behaviour can't happen here. The dialog tracks the version it opened (
knowledge-entry-edit-dialog.tsx:48-50) and showseditDialog.newerVersionwhen it's dirty (:124-128): "A newer version was published while you were editing. Your draft is still here; save it to replace that version, or cancel and discard it." That needs the same dialog to receive the newer entry. Only the record view keeps it, because it resolves the entry bydocumentId ?? _id(knowledge-entries-table.tsx:56,knowledge-entry-view-dialog.tsx:113).
Example (the spec's own, KENTRY-R5): Mia opens Edit from the row menu. Noah saves a correction. Mia's dialog disappears with her text, without a word.
Expected
- Keep the row-menu edit dialog mounted across a new version: hoist it out of the row (as the record view does), or give the table
getRowId: (entry) => entry.documentId ?? entry._id. Then the draft and the newer-version warning survive. - Regression: a knowledge-entries table test that opens Edit from the row menu, types a change, then replaces the entry with a newer version (same
documentId, new_id). The dialog stays open with the draft and shows the newer-version alert. On4cde0834athe dialog is gone.
Severity and owner
- Severity: medium. An ordinary concurrent edit silently discards typed knowledge content, against the dialog's own promise.
- Owner: platform (knowledge entries).
- Related: Bug: Team membership refresh silently replaces unsaved roster selections #3584 (a team roster refresh replaces unsaved selections, the same class on another surface).
- Found by: Review A (TALE-358), 2026-10-12 16:15 Zurich occurrence. A worker raised it as lead E1 at 08:15; I verified it at
4cde0834a. This is static reading; I didn't run it, because Review A's stack is BLOCKED.
Activity
fix(platform): keep a knowledge entry's draft when someone else saves it
fix(platform): keep a knowledge entry's draft when someone else saves it