Summary
When using plannotator annotate on a file with markdown links to other files, annotations left on the original file are silently dropped if you click "Send Annotations" while viewing a linked document.
The UI correctly displays the total annotation count across all files, but the submission endpoint only sends annotations from the currently-viewed file. As far as I can tell, Dropped annotations are irrecoverable, I wasn't able to find them persisted on disk (e.g. in /tmp).
Reproduction
- Run
plannotator annotate original.md where original.md contains a markdown link to linked.md (e.g. [link text](linked.md))
- Leave one or more annotations on
original.md
- Click the link to navigate to
linked.md
- Leave one or more annotations on
linked.md
- Click "Send Annotations" without navigating back to
original.md
Expected: All annotations are submitted (from both files).
Actual: Only annotations from linked.md are submitted. Annotations on original.md are silently and irrecoverably lost.
UI evidence
When viewing the original file, the sidebar correctly shows the full count across both files ("ANNOTATIONS 3, +1 in 1 other file"):
When viewing the linked file, the sidebar only shows that file's annotations ("ANNOTATIONS 1") with no awareness of annotations on the original file:
The "Send Annotations" button submits whichever count is displayed, not the total.
Severity
This is a data loss bug. In my case, I spent several minutes writing detailed annotations on the original file, followed a link to annotate a second file, and clicked "Send Annotations" from there. The original file's annotations were silently dropped with no warning or confirmation. A thorough search of /tmp and plannotator's session directories confirmed they were not persisted anywhere. I think they are gone but at some point gave up looking for them!
Root cause
DISCLAIMER: I frequently use plannotator but I am unfamiliar with its codebase. I commandeered Claude Code to verify this was indeed a bug and not expected behaviour. So while I have confirmed everything above myself, the root cause analysis is Claude's and the relationship to #373 / PR #376 below was identified by Claude before I opened this issue because I didn't want to create noise.
I manually verified that PR #376 is relevant to the issue and based on my (limited) understanding of plannotator's internals, what Claude found is a plausible explanation for the bug.
In packages/editor/App.tsx, handleAnnotateFeedback (around line 852) sends only allAnnotations to /api/feedback:
body: JSON.stringify({
feedback: annotationsOutput,
annotations: allAnnotations,
}),
allAnnotations includes the current document's annotations and external SSE annotations, but not linked document annotations stored in linkedDocHook.getDocAnnotations().
The UI correctly uses linkedDocHook.docAnnotationCount for display and button enablement (lines ~1048, 1302–1306), but this data is never included in the submission payload.
Relationship to #373 / PR #376
This appears to be an incomplete fix from PR #376, which addressed #373 ("plannotator-annotate will not let you submit annotations if you only annotate a linked document"). That PR updated the validation logic (enabling the "Send Annotations" button when linked doc annotations exist) but did not update the submission logic to actually include those annotations in the POST body.
Workaround
Navigate back to the original file before clicking "Send Annotations." The original file view is aware of all annotations across files and submits them correctly.
Summary
When using
plannotator annotateon a file with markdown links to other files, annotations left on the original file are silently dropped if you click "Send Annotations" while viewing a linked document.The UI correctly displays the total annotation count across all files, but the submission endpoint only sends annotations from the currently-viewed file. As far as I can tell, Dropped annotations are irrecoverable, I wasn't able to find them persisted on disk (e.g. in
/tmp).Reproduction
plannotator annotate original.mdwhereoriginal.mdcontains a markdown link tolinked.md(e.g.[link text](linked.md))original.mdlinked.mdlinked.mdoriginal.mdExpected: All annotations are submitted (from both files).
Actual: Only annotations from
linked.mdare submitted. Annotations onoriginal.mdare silently and irrecoverably lost.UI evidence
When viewing the original file, the sidebar correctly shows the full count across both files ("ANNOTATIONS 3, +1 in 1 other file"):
When viewing the linked file, the sidebar only shows that file's annotations ("ANNOTATIONS 1") with no awareness of annotations on the original file:
The "Send Annotations" button submits whichever count is displayed, not the total.
Severity
This is a data loss bug. In my case, I spent several minutes writing detailed annotations on the original file, followed a link to annotate a second file, and clicked "Send Annotations" from there. The original file's annotations were silently dropped with no warning or confirmation. A thorough search of
/tmpand plannotator's session directories confirmed they were not persisted anywhere. I think they are gone but at some point gave up looking for them!Root cause
In
packages/editor/App.tsx,handleAnnotateFeedback(around line 852) sends onlyallAnnotationsto/api/feedback:allAnnotationsincludes the current document's annotations and external SSE annotations, but not linked document annotations stored inlinkedDocHook.getDocAnnotations().The UI correctly uses
linkedDocHook.docAnnotationCountfor display and button enablement (lines ~1048, 1302–1306), but this data is never included in the submission payload.Relationship to #373 / PR #376
This appears to be an incomplete fix from PR #376, which addressed #373 ("plannotator-annotate will not let you submit annotations if you only annotate a linked document"). That PR updated the validation logic (enabling the "Send Annotations" button when linked doc annotations exist) but did not update the submission logic to actually include those annotations in the POST body.
Workaround
Navigate back to the original file before clicking "Send Annotations." The original file view is aware of all annotations across files and submits them correctly.