Skip to content

Comments: no false load error after a write; steady signing notice - #93

Merged
callumalpass merged 1 commit into
mainfrom
fix/comments-false-errors-91
Nov 12, 2026
Merged

callumalpass merged 1 commit into
mainfrom
fix/comments-false-errors-91

Conversation

@callumalpass

Copy link
Copy Markdown
Contributor

Refs #91

A. "Comments could not be loaded" after each write

Cause (Writer integration, not the shared @mdbase-dev/ui package): the collection watch reports a write while it is still pending, and the workspace reloads comments 50 ms later. NativeWriterBackend's body read (bodies(), and contractRecord under it) required state: "confirmed". It therefore refused the pending record that the write had just made, with "Writer's selected record changed or is protected." No later change arrives when the write confirms, so the error stayed until Try again.

Fix: display reads of comment and annotation bodies accept a pending record and still refuse a hold or an unresolved conflict. Writes, write readbacks and readBody keep requiring a confirmed record. A rejected write is rolled back and arrives as another change.

B. Signing notice flips while identity succeeds

Cause (deterministic part): people in the workspace snapshot was written by both loadComments() and refreshPeople() (on focus or Check again), whichever finished last. A slow, older check could replace a newer one. A tab could then say "not linked" while new comments were signed with the fresh state. Fix: checks apply in the order they started.

Likely contributor (not reproduced against production): the SDK people directory throws unavailable when its read session is replaced mid-check (people_fenced) or the person inventory is briefly incomplete. Writer turned that straight into "could not check the account's person record" although /identity returned 200. It now retries once after 250 ms.

Tests

  • native.test.ts: with confirmations stalled on MemoryReplica, a reload after a resolve and after a reply returns the comments without an error. This test fails on main with the production message. A held or conflicted body is still refused. A transient directory failure is retried once.
  • workspace.test.ts: an older account check that finishes last doesn't replace a newer linked state.
  • pnpm check passes (i18n, typecheck, 369 app tests, 51 core tests).

No persisted comment format or public API change. Issue 92 (withdrawing a thread root after replies) is untouched.

The collection watch reports a write before it confirms, and the panel
reloads comments 50 ms later. The comment body read required a confirmed
record, so it refused the pending record the write had just made and showed
"Writer's selected record changed or is protected". Display reads of
comment and annotation bodies now accept a pending record and refuse only a
hold or an unresolved conflict; writes and readbacks stay strict.

The signing notice took its people state from whichever account check
finished last, so a slow, older check could replace a newer one (a tab
showed "not linked" while signing). Checks now apply in start order, and
a transient `unavailable` people-directory failure is retried once before
the notice says the account could not be checked.

Refs #91
@callumalpass
callumalpass merged commit 3d3ff44 into main Nov 12, 2026
1 of 2 checks passed
@callumalpass
callumalpass deleted the fix/comments-false-errors-91 branch November 12, 2026 14:14
@callumalpass

Copy link
Copy Markdown
Contributor Author

Supervisor: this is live. writer.mdbase.dev serves 3d3ff44, published by App CD run 43240570517 at about 14:52Z. Ready for the testing rotation's retest.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant