#429·OfficeCLI

add --type comment doesn't sync commentsExtended.xml/commentsIds.xml/commentsExtensible.xml unless done/parentId is passed

Author: pw201Created Sep 23, 2026Updated Sep 24, 2026

What happens

Adding a comment to a docx that already has real threaded comments (and therefore already has commentsExtended.xml, commentsIds.xml, and commentsExtensible.xml alongside comments.xml) only writes the new comment into comments.xml. The other three parts are left untouched unless done or parentId is passed explicitly on add — and even then, only commentsExtended.xml gets an entry. commentsIds.xml and commentsExtensible.xml have no equivalent prop at all and are never written to, regardless of what's passed.

This leaves the four comment-related parts cross-referentially inconsistent (each individually schema-valid, so officecli validate doesn't catch it), and Word flags the file as needing repair when a human opens it ("Word found unreadable content, do you want to recover this document?").

Repro

  1. officecli create test.docx, add a paragraph, add a comment, then officecli set done=true on it — this creates commentsExtended.xml with one entry (confirming the part only appears once something explicitly writes to it).
  2. Add a second comment with officecli add --type comment --prop text=... --prop author=..., with or without --prop done=false.
  3. Inspect the docx zip: comments.xml has both comments. commentsExtended.xml only has the first (or, with done=false on the second add, both — but commentsIds.xml/commentsExtensible.xml never get an entry for either comment, ever).

Expected

add --type comment keeps all four comment parts consistent, matching what Word itself writes when a human adds a comment.

Environment

officecli 1.0.146, Windows.

Additional context

Compared this against Word's own repair-on-open behavior for a file left in this inconsistent state. Word's repair does correctly reconcile commentsExtended.xml and commentsIds.xml (adds the missing comment's entry to both), but drops commentsExtensible.xml entirely rather than reconciling it — so even Word's own recovery path doesn't fully restore that fourth part.