CANVAS: Rename can lose the stable Note identity on reload #1019

Open
opened 2026-10-03 15:47:28 +00:00 by kayg · 1 comment
Owner

The real Canvas creation/rename browser flow can lose the stable Note lookup after Rename. This blocks #976.

Evidence on job/canvas-core-976, merged origin/dev at 90710eaaa:

  • New Canvas creates a real .excalidraw.md Note and opens the title dialog.
  • Rename to Planning moves the sidebar entry to planning.excalidraw.
  • A reload can show This note is not here anymore at the original stable Note identity. The sidebar also shows an Untitled canvas entry.
  • The full flow previously reached live co-editing, then an element-link open showed an Untitled canvas header and no element selection.
  • A focused tail run, which cancels repeated screenshot reloads and performs the same initial Rename, failed waiting for Canvas ready after the Rename/reload. Its failure screenshot shows the missing Note state and both sidebar entries.

Reproduce against the real production build and this branch's server:

CANVAS_PROBE_REVIEW_TAIL=1 CALTERNAL_SERVER_BIN=<job-server> bun apps/web/e2e/canvas-976.mjs

Do not change the expected stable identity or skip this flow in the merge gate. Inspect Rename, filesystem adoption, and Index identity updates together. Confirm that Rename retains calternal-id, lookup by that ID, title and source bytes through live saves and reloads.

A separate diagnostic run that cancels the Rename dialog is used only to reach remaining Canvas render/link/export evidence. It is not a substitute for this failing flow. READY FOR MERGE remains no.

The real Canvas creation/rename browser flow can lose the stable Note lookup after Rename. This blocks #976. Evidence on job/canvas-core-976, merged origin/dev at 90710eaaa: - New Canvas creates a real `.excalidraw.md` Note and opens the title dialog. - Rename to Planning moves the sidebar entry to `planning.excalidraw`. - A reload can show `This note is not here anymore` at the original stable Note identity. The sidebar also shows an Untitled canvas entry. - The full flow previously reached live co-editing, then an element-link open showed an Untitled canvas header and no element selection. - A focused tail run, which cancels repeated screenshot reloads and performs the same initial Rename, failed waiting for Canvas ready after the Rename/reload. Its failure screenshot shows the missing Note state and both sidebar entries. Reproduce against the real production build and this branch's server: ``` CANVAS_PROBE_REVIEW_TAIL=1 CALTERNAL_SERVER_BIN=<job-server> bun apps/web/e2e/canvas-976.mjs ``` Do not change the expected stable identity or skip this flow in the merge gate. Inspect Rename, filesystem adoption, and Index identity updates together. Confirm that Rename retains `calternal-id`, lookup by that ID, title and source bytes through live saves and reloads. A separate diagnostic run that cancels the Rename dialog is used only to reach remaining Canvas render/link/export evidence. It is not a substitute for this failing flow. READY FOR MERGE remains no.
Author
Owner

Fresh branch production server reproduced the missing identity immediately after Rename. The sequential test passes because it reads only after rename finishes. get_note previously looked up the old path without the per-User writer lock while the journalled rename deletes the old source and replaces the Index mapping. Fixed at the read boundary: hold the existing lock only for path lookup plus source read; parse outside it. A deterministic regression verifies that GET waits while the rename lock is held and returns the same ID at the new path. Focused test passes; Notes clippy passes. Browser confirmation follows.

Fresh branch production server reproduced the missing identity immediately after Rename. The sequential test passes because it reads only after rename finishes. get_note previously looked up the old path without the per-User writer lock while the journalled rename deletes the old source and replaces the Index mapping. Fixed at the read boundary: hold the existing lock only for path lookup plus source read; parse outside it. A deterministic regression verifies that GET waits while the rename lock is held and returns the same ID at the new path. Focused test passes; Notes clippy passes. Browser confirmation follows.
Sign in to join this conversation.
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
kayg/calternal#1019
No description provided.