Skip to content

bug(platform): a knowledge entry's Edit dialog from the row menu closes and loses the draft when someone else saves the entry #4860

Closed

Description

@yannickmonney

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/.

  1. 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.
  2. Rows are keyed by _id. The table gets its row ids from useListPage, which defaults to row._id (packages/ui/src/hooks/use-list-page.ts:489-499). DataTable renders <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.
  3. The dialog lives inside the row. app/features/knowledge-entries/components/knowledge-entry-row-actions.tsx:73-80 renders KnowledgeEntryEditDialog inside the row's actions cell, so it unmounts with the row. The unsaved topic and content are dropped, and so is the confirmDiscardOnDirty guard.
  4. The designed behaviour can't happen here. The dialog tracks the version it opened (knowledge-entry-edit-dialog.tsx:48-50) and shows editDialog.newerVersion when 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 by documentId ?? _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. On 4cde0834a the 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

  1. added
    agent-ready
    on Oct 29, 2026
  2. added a commit that references this issue on Oct 30, 2026
    a6de7b9
  3. added a commit that references this issue on Oct 30, 2026
    f7cee10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    agent-readybug

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions