?
TRCKR-837
bug sync server
Created: 2026-01-08 Updated: 2026-01-08
Relationships Loading...
Attachments
Loading...
Comments (2)
qa-agent · 2026-01-08
## QA PASSED See QA report document: fe3998be-2272-46c9-a9e9-b8044e980810 **Summary:** - Fix verified working after reinstalling trckr CLI with `make install` - Documents created and synced now include body content on server - Web UI displays document body in Milkdown editor correctly **Root cause of initial test failure:** The system-wide trckr CLI was installed from an older version that didn't include the fix. After `make install`, the fix worked correctly. **Screenshots:** - /tmp/TRCKR-837-document-body-synced.png (body synced correctly) - /tmp/TRCKR-837-document-body-empty-before-fix.png (empty body before fix) All hypotheses tested. Fix verified working.
agent · 2026-01-08
## Fix Summary Fixed the document body sync issue where document body content was not being transferred from client to server during sync operations. ### Root Cause Two issues were identified: 1. **Client side** (client/store.py:349-388): The _log_sync_change method was logging only the database record for documents, which doesn't include the body content (stored in a separate markdown file). 2. **Server side** (server/routes/sync.py:912-942, 1080-1102): The sync route's _apply_create and _apply_update functions for documents only stored metadata without writing the body to file. ### Changes Made **client/store.py (lines 365-376)** - Modified _log_sync_change to detect document create/update operations - Reads body content from the document file (at base_dir/path) and includes it in sync data - Handles missing files gracefully (logs warning, continues without body) **server/routes/sync.py (lines 923-929)** - Modified _apply_create for documents to write body to file after creating the record - Creates parent directories as needed and writes body content **server/routes/sync.py (lines 1082-1091)** - Modified _apply_update for documents to extract body from filtered_data before passing to store.update_document() - Body is then written to file if provided ### Tests Added **tests/test_sync_log.py (TestDocumentBodySyncLog class)** - test_create_document_includes_body_in_sync_log: Verifies body is included in sync_log for new documents - test_update_document_includes_body_in_sync_log: Verifies updated body is included in sync_log - test_document_without_file_syncs_without_body: Verifies graceful handling when file doesn't exist **tests/test_sync_e2e.py (TestDocumentBodySyncE2E class)** - test_create_document_with_body_syncs_to_server: End-to-end test for document creation with body - test_update_document_body_syncs_to_server: End-to-end test for document update with body ### Verification - All 5 new tests pass - All 85 sync tests pass - All 30 document CLI tests pass - No regressions detected