Skip to content
This repository was archived by the owner on Nov 15, 2026. It is now read-only.

feat(notes,web): a note link that survives a moved or deleted note - #9

Merged
bketelsen merged 1 commit into
mainfrom
fix/note-link
Oct 21, 2026
Merged

bketelsen merged 1 commit into
mainfrom
fix/note-link

Conversation

@bketelsen

Copy link
Copy Markdown
Contributor

Brian asked on 2026-10-21: when the note an item links to is gone, the reader shows Save as note again; when it was renamed or moved, Open in Notes finds it; when notes cannot be reached, show an error and keep the link.

  • New notes carry read_item: /read/item/<id> in their frontmatter.
  • items.noteStatus{id} (5 s): read_note at the path → present; else list_notes by the read_item property → moved (path updated); else the first 50 notes under Reading/ are checked for the item's /read/item/<id> link (notes written before the marker) → moved; else missing (path cleared). A transport, auth or protocol error or the timeout → unreachable, path kept.
  • Not detected: an old note (no marker) moved out of Reading/; a note whose marker and link were edited away; an old note beyond the first 50 under Reading/. The spec says so.
  • The web app checks on opening an item with a note and on each Open in Notes click. readctl note-status <id>.
  • Tests: present, moved by marker, moved by old link, missing, unreachable (Go and web); a contract golden.
  • Live on make dev-lodge: delete → Save as note; rename → opens the renamed note; move to another folder → found; notesd stopped → error line, link kept.

After merge: redeploy to lodge's host and check the deleted test note's item.

Gates: make check, make web-check (57 tests), make web-build.

Every new note's frontmatter holds read_item: /read/item/<id>. The new
items.noteStatus asks notes within 5 seconds: present at note_path, else a
note with the marker (list_notes property filter), else a note under
Reading/ that holds the item's link (at most 50 read). A moved note records
its new path; a missing one clears note_path; notes out of reach keeps it
and reports the error. The reader asks when it opens an item and when the
owner clicks Open in Notes: a missing note turns the button back into Save
as note, a moved one opens its new path, and an unreachable notes keeps the
link with an error line. readctl gains note-status.
@bketelsen
bketelsen merged commit 9c98f90 into main Oct 21, 2026
3 checks passed
@frostyard-machines
frostyard-machines deleted the fix/note-link branch October 26, 2026 00:21
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant