fix(annotate): add /api/save-notes POST endpoint to annotate server#884
Open
titosemi wants to merge 2 commits into
Open
fix(annotate): add /api/save-notes POST endpoint to annotate server#884titosemi wants to merge 2 commits into
titosemi wants to merge 2 commits into
Conversation
Copies the save-notes route from the plan review server into the annotate server (Bun source and Pi extension copy), enabling Save to Obsidian in annotation mode. Fixes backnotprop#844
Verifies saveToObsidian writes files correctly and handles missing vaults. HTTP endpoint tests cover success, empty integrations, and integration-level error (not 500). Imports consolidation from ./integrations into a single statement.
Owner
|
thank you! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #844
Problem
Saving annotations to Obsidian (
Save to Obsidianbutton) fails silently in annotation mode. The button is visible and clickable but nothing happens because the annotate server lacks the/api/save-notesPOST route.The plan review server has this route and works correctly — only the annotate server was missing it.
Root Cause
packages/server/annotate.ts(Bun source) andapps/pi-extension/server/serverAnnotate.ts(Pi extension copy) did not implement the/api/save-noteshandler. When the frontend sends the save request in annotation mode, the server falls through to the HTML catch-all route, returning the SPA HTML instead of JSON.Changes
packages/server/annotate.ts— Added/api/save-notesPOST route handler with the same integration logic asserverPlan.ts: acceptsobsidian,bear, andoctarineconfigs, runs configured saves in parallel, returns{ ok: true, results }.apps/pi-extension/server/serverAnnotate.ts— Same route added to the Pi extension copy of the annotate server.packages/server/integrations.test.ts— AddedsaveToObsidianunit tests (success and missing vault cases). Consolidated duplicate imports from./integrationsinto a single statement.packages/server/annotate.test.ts— HTTP endpoint tests for the new route (success, empty integrations, integration-level error).Testing
All 205 server tests pass, 0 fail.