You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Backend: Allow blank text nodes in validation #484
Phase 1 of #479 changed the frontend to persist blank nodes immediately (with 500ms debounce). However, the backend validation is rejecting these blank nodes with:
ValidationFailed(MissingField("Text nodes must have content"))
Problem Found:
While PR #502 updated the Rust model layer validation to allow blank text nodes, the HTTP endpoint is still rejecting blank nodes with 422 Unprocessable Entity.
Evidence:
✅ Rust unit tests pass: test_node_validation_accepts_blank_content
❌ Integration tests fail: All 9 tests in blank-node-creation.test.ts fail with HTTP 422
❌ Dev server returns: POST http://localhost:3001/api/nodes 422 (Unprocessable Entity)
Root Cause:
The model layer (packages/core/src/models/node.rs) allows blank content, but there's likely additional validation in the HTTP handler that's still enforcing the "content must not be empty" rule.
Investigation Needed:
Check HTTP endpoint handlers (likely src-tauri/src/handlers/nodes.rs or MCP handlers)
Find where the 422 validation error originates
Remove or update that validation check
Verify all integration tests pass
Test Command:
bun run dev # Start dev server
bun run test:db # Run integration tests with database mode
Expected Result:
All 9 integration tests in blank-node-creation.test.ts should pass.
Look for validation logic that checks content.is_empty() or similar
Service Layer:
packages/core/src/services/node_service.rs
Check create_node() or validate_node_data() methods
Schema Validation:
Any JSON schema validation that might enforce non-empty content
Check for request validation middleware
How to Reproduce
# 1. Start dev server
bun run dev
# 2. Wait for proxy to compile and start (check http://localhost:3001/health returns "OK")
curl http://localhost:3001/health
# 3. Run integration tests (will fail with 422 errors)
bun run test:db
# 4. Look specifically at blank-node-creation testscd packages/desktop-app && TEST_USE_DATABASE=true bunx vitest run src/tests/integration/blank-node-creation.test.ts
Expected Fix
Find the HTTP handler validation that's rejecting blank content and either:
Remove it (if redundant with model validation), OR
Update it to allow blank content for text nodes (matching the model layer)
Success Criteria
bun run test:db # All tests should pass, including 9 blank-node-creation tests
Context Files to Read First
packages/core/src/models/node.rs:397-400 - See how model layer allows blank content
packages/desktop-app/src/tests/integration/blank-node-creation.test.ts - Understand what tests expect
HTTP handler files (TBD - need to search for the 422 source)
Quick Start Command for Next Session
# Assign yourself and start
bun run gh:assign 484 "@me"
bun run gh:status 484 "In Progress"# Start investigationcd /Users/malibio/nodespace/nodespace-core
bun run dev # Terminal 1: Start dev server# Wait for health check to pass, then in another terminal:
bun run test:db # Terminal 2: Reproduce the failures
Activity
Fix orphaned node creation and backend validation (#479)
Phase 1: Eliminate ephemeral nodes during editing (#479) (#483)
Fix: Allow blank text nodes in validation (Issue #484)
Fix: Allow blank text nodes in validation (Issue #484)
Fix: Allow blank text nodes in validation (Issue #484)
Address code review feedback: Add integration tests and enhance docum…
Backend: Allow blank text nodes in validation (#502)
Refactor: Rename test to better reflect blank content acceptance
malibio commentedon Nov 14, 2025
Issue Reopened - Integration Tests Failing
Problem Found:
While PR #502 updated the Rust model layer validation to allow blank text nodes, the HTTP endpoint is still rejecting blank nodes with 422 Unprocessable Entity.
Evidence:
test_node_validation_accepts_blank_contentblank-node-creation.test.tsfail with HTTP 422POST http://localhost:3001/api/nodes 422 (Unprocessable Entity)Root Cause:
The model layer (
packages/core/src/models/node.rs) allows blank content, but there's likely additional validation in the HTTP handler that's still enforcing the "content must not be empty" rule.Investigation Needed:
src-tauri/src/handlers/nodes.rsor MCP handlers)Test Command:
Expected Result:
All 9 integration tests in
blank-node-creation.test.tsshould pass.malibio commentedon Nov 14, 2025
Investigation Summary for Next Session
Problem Confirmation
The backend model layer allows blank text nodes (PR #502 ✅), but the HTTP endpoint layer is rejecting them with 422 Unprocessable Entity ❌.
What Works
test_node_validation_accepts_blank_contentinpackages/core/src/models/node.rs:1227Node::validate()atpackages/core/src/models/node.rs:397-400What's Broken
packages/desktop-app/src/tests/integration/blank-node-creation.test.tsfailPOST http://localhost:3001/api/nodes 422 (Unprocessable Entity)Test Output
Where to Look
The validation is likely happening in one of these locations:
HTTP Handlers (most likely):
packages/desktop-app/src-tauri/src/handlers/nodes.rsor similarpackages/desktop-app/src-tauri/src/mcp/handlers/nodes.rs(MCP handlers)content.is_empty()or similarService Layer:
packages/core/src/services/node_service.rscreate_node()orvalidate_node_data()methodsSchema Validation:
How to Reproduce
Expected Fix
Find the HTTP handler validation that's rejecting blank content and either:
Success Criteria
bun run test:db # All tests should pass, including 9 blank-node-creation testsContext Files to Read First
packages/core/src/models/node.rs:397-400- See how model layer allows blank contentpackages/desktop-app/src/tests/integration/blank-node-creation.test.ts- Understand what tests expectQuick Start Command for Next Session
9 remaining items
Phase 1: Eliminate ephemeral nodes during editing (#479) (#483)
Backend: Allow blank text nodes in validation (#502)
Refactor: Rename test to better reflect blank content acceptance
Backend: Allow blank text nodes in validation (#504)
Fix: Allow blank content for all content node types (#508)
Phase 1: Eliminate ephemeral nodes during editing (#479) (#483)
Backend: Allow blank text nodes in validation (#502)
Refactor: Rename test to better reflect blank content acceptance
Backend: Allow blank text nodes in validation (#504)
Fix: Allow blank content for all content node types (#508)
Phase 1: Eliminate ephemeral nodes during editing (#479) (#483)
Backend: Allow blank text nodes in validation (#502)
Refactor: Rename test to better reflect blank content acceptance
Backend: Allow blank text nodes in validation (#504)
Fix: Allow blank content for all content node types (#508)