Repository navigation
Closed
Description
Problem
The mention sync system is not creating mention relationships in the database when using bun run dev (HTTP dev server mode). Users can create @mentions in content, but the bidirectional links are not being stored.
Investigation Findings
What Works
- ✅ Backend:
POST /api/nodes/mentionendpoint exists in HTTP dev server - ✅ Backend: Node CRUD operations work (POST/PATCH
/api/nodes) - ✅ Backend: BacklinksPanel queries work (GET
/api/nodes/{id}/mentioning-containers) - ✅ Frontend: MentionSyncService exists and has correct logic
- ✅ Frontend: SharedNodeStore calls
mentionSyncService.syncMentions()on line 542 - ✅ Frontend: HttpBackendAdapter.createNodeMention() method exists and calls correct endpoint
What's Broken
- ❌ NO
POST /api/nodes/mentionnetwork requests are being made - ❌ No mention records in
node_mentionsdatabase table - ❌ BacklinksPanel shows 0 mentions even after creating
[@Node](nodespace://id)links
Evidence from Logs
Backend HTTP server logs show content updates:
📝 UPDATE request for node: 5066ebc3-... with content: "[@Some New Node](nodespace://e937a199-...)"
✅ Updated node: 5066ebc3-...
Network requests show NO mention creation:
✅ PATCH http://localhost:3001/api/nodes/5066ebc3-... [200] <-- Content saved
❌ POST http://localhost:3001/api/nodes/mention <-- Never called!
Console shows NO mention sync errors:
- No
[SharedNodeStore] Failed to sync mentionserrors - No network failures for mention endpoints
- Silent failure - sync code not executing
Root Cause Hypothesis
SharedNodeStore.setNode() may not be called during PATCH updates in HTTP dev mode. The updates might be:
- Going directly to HTTP adapter bypassing SharedNodeStore
- Using a code path that doesn't trigger the mention sync logic (line 540-545)
- Content comparison
oldNode?.content !== node.contentfailing to detect changes
Expected Behavior
When user creates content like:
[@Some New Node](nodespace://e937a199-3d59-470b-b947-40a67228fc41)
Should see:
- Network request:
POST /api/nodes/mentionwith{mentioningNodeId, mentionedNodeId} - Database record in
node_mentionstable - BacklinksPanel on mentioned node shows the mentioning container
Reproduction Steps
- Run
bun run dev(frontend only) - Run
cargo run --bin dev-server(HTTP backend on port 3001) - Navigate to a date page
- Create a node
- Type
@to trigger autocomplete - Select a node to create mention link
- Check network tab - no POST to
/api/nodes/mention - Check database:
sqlite3 ~/.nodespace/database/nodespace-dev.db "SELECT * FROM node_mentions;" - Result: Empty table
Next Steps
- Add debug logging to SharedNodeStore.setNode() to verify it's being called during PATCH
- Add logging to MentionSyncService.syncMentions() to see if it's extracting mentions
- Verify content comparison logic detects mention additions
- Check if HTTP adapter updates flow through SharedNodeStore or bypass it
Related
- Issue Backlinks UI Panel - Display 'Mentioned By' References #318 (BacklinksPanel UI) - Complete, but can't test end-to-end without mention sync
- MentionSyncService implementation exists and looks correct
- Backend endpoints exist and are registered
Activity
fix: Add mention sync to updateNode() to fix HTTP dev mode (issue #341)
refactor: Address all code review feedback for issue #341
fix: Add mention sync to updateNode() to fix HTTP dev mode (issue #341)
refactor: Address all code review feedback for issue #341
Merge branch 'feature/issue-341-fix-mention-sync-http-dev' into main
fix: Add mention sync to updateNode() to fix HTTP dev mode (issue #341)
refactor: Address all code review feedback for issue #341
Merge branch 'feature/issue-341-fix-mention-sync-http-dev' into main
fix: Add mention sync to updateNode() to fix HTTP dev mode (issue #341)
refactor: Address all code review feedback for issue #341
Merge branch 'feature/issue-341-fix-mention-sync-http-dev' into main