Repository navigation
Closed
Description
Frontend: Send Flat Properties Directly
Summary
Remove the legacy nested property format from frontend requests. Frontend should send flat properties directly to match the graph-native architecture.
Background
Issue #511 introduced graph-native architecture where type-specific properties are stored in separate tables (e.g., task table) and linked via data field.
Current workaround (packages/core/src/db/surreal_store.rs:218-258): Backend unwraps nested properties for backward compatibility, but this is temporary.
Problem
Current frontend behavior (nested - LEGACY):
{
"content": "Buy milk",
"nodeType": "task",
"properties": {
"task": {
"status": "OPEN",
"priority": "HIGH"
}
}
}Expected flat format (graph-native):
{
"content": "Buy milk",
"nodeType": "task",
"properties": {
"status": "OPEN",
"priority": "HIGH"
}
}Issues with nested format:
- Inconsistent with database (backend stores properties flat in task table)
- Unnecessary coupling (frontend duplicates type name in properties object)
- Backend workaround required (performance cost)
- Violates DRY (nodeType field already specifies the type)
Proposed Solution
Phase 1: Update Frontend Property Serialization
- Locate property serialization in frontend codebase
- Update serialization logic to send flat properties
- Key files to check:
- src/lib/services/backend-adapter.ts
- src/lib/design/components/base-node.svelte
- src/lib/design/components/task-node.svelte
Phase 2: Remove Backend Unwrapping
Once frontend sends flat properties:
- Remove unwrap_legacy_property_format() function
- Remove calls to unwrapper in create_node() and update_node()
- Update tests to use flat property format
Phase 3: Add Validation
Backend should reject nested format with clear error messages.
Testing Strategy
- Frontend tests: Verify task creation/updates send flat properties
- Integration tests: Create/update tasks, verify properties saved correctly
- Regression testing: Create task via slash command, edit properties
Acceptance Criteria
- Frontend sends flat properties
- No nested type wrapper format
- Backend unwrap_legacy_property_format() function removed
- Backend validation rejects nested format
- All tests pass
- No regression in task creation/editing
Timeline
Target completion: 2025-12-15 (aligns with Issue #514 deprecation timeline)
Related Issues
- Issue SurrealDB Schema Refactor: Graph-Native Architecture #511: SurrealDB graph-native architecture (parent)
- Issue Remove parent_id/container_node_id from Node API - Complete Graph Migration #514: Remove parent_id/container_node_id from API (related)
- PR SurrealDB Schema Refactor: Graph-Native Architecture #513: Code review identified this technical debt
References
- Backend workaround: packages/core/src/db/surreal_store.rs:218-258
- Backend usage: packages/core/src/db/surreal_store.rs:841, 1013
Activity
Address code review: Add deprecation warnings, recursive tree query, …
Remove legacy property format handling (pre-release cleanup)
malibio commentedon Nov 16, 2025
Closed in commit 015dfa8. Removed legacy property format handling instead of deprecating (pre-release cleanup). Frontend already sends flat properties after graph refactor.
SurrealDB Schema Refactor: Graph-Native Architecture (#513)
SurrealDB Schema Refactor: Graph-Native Architecture (#513)
SurrealDB Schema Refactor: Graph-Native Architecture (#513)
SurrealDB Schema Refactor: Graph-Native Architecture (#513)