Problem
After using bm project bisync, files sync correctly to S3 storage but don't appear in the web app at app.basicmemory.com. The web app shows stale data while the actual disk and S3 storage have the correct data.
Root Cause
The sync worker uses incremental scanning based on filesystem modification timestamps to detect changes. However, rclone bisync writes directly to S3 without updating filesystem timestamps in a way the scanner can detect.
Evidence
Logfire logs for tenant 43eb3b88-62ac-26e3-4fc3-ca352617725e show:
- At
2025-10-31T03:18:21.948150Z: Worker detected 2 deletions
- Every 30 seconds after: Worker reports
"total_changes=0, found 0 changes (new=0, modified=0, deleted=0, moves=0)"
- New files created via bisync: Never detected
Example log entry:
"Completed incremental scan for directory /app/data/bmem in 111ms, found 0 changes (new=0, modified=0, deleted=0, moves=0)"
Impact
- ❌ Users see incorrect data in web app after using bisync
- ❌ No manual way to force database sync
- ❌ No status endpoint to check sync progress
- ⚠️ The bisync output says "Database sync initiated" but this is misleading - the sync runs but finds nothing to update
Technical Details
- S3 Storage: ✅ Correct (matches local disk)
- PostgreSQL Database: ❌ Stale (shows old deleted files, missing new files)
- Sync Worker: Runs every 30 seconds in
sync_worker.py:sync_project_background()
- Detection Method: Incremental scan via filesystem modification times
- The Gap: Rclone → S3 writes don't trigger detectable filesystem changes
Test Case to Reproduce
- Set up project with
bm project sync-setup <project> <path>
- Run
bm project bisync --name <project> --resync
- Create a new file locally:
echo "test" > ~/bmem/tests/newfile.md
- Run
bm project bisync --name <project>
- Verify file exists in S3:
bm project ls --name <project> tests/ ✅ Shows file
- Check web app at app.basicmemory.com ❌ File not listed
- Check Logfire sync worker logs: Shows
total_changes=0
Suggested Solutions
- Option A: Trigger full scan after bisync completes (instead of incremental)
- Option B: Have bisync call a database sync API endpoint that forces a rescan
- Option C: Make rclone update filesystem metadata in a detectable way
- Option D: Use S3 event notifications to trigger database sync
Related
Severity
High - This breaks the core value proposition of cloud sync. Users can't trust that the web app reflects their actual data after using bisync.
Problem
After using
bm project bisync, files sync correctly to S3 storage but don't appear in the web app at app.basicmemory.com. The web app shows stale data while the actual disk and S3 storage have the correct data.Root Cause
The sync worker uses incremental scanning based on filesystem modification timestamps to detect changes. However, rclone bisync writes directly to S3 without updating filesystem timestamps in a way the scanner can detect.
Evidence
Logfire logs for tenant
43eb3b88-62ac-26e3-4fc3-ca352617725eshow:2025-10-31T03:18:21.948150Z: Worker detected 2 deletions"total_changes=0, found 0 changes (new=0, modified=0, deleted=0, moves=0)"Example log entry:
Impact
Technical Details
sync_worker.py:sync_project_background()Test Case to Reproduce
bm project sync-setup <project> <path>bm project bisync --name <project> --resyncecho "test" > ~/bmem/tests/newfile.mdbm project bisync --name <project>bm project ls --name <project> tests/✅ Shows filetotal_changes=0Suggested Solutions
Related
src/basic_memory_cloud_api/sync_worker.pysrc/basic_memory/cli/commands/project.pySeverity
High - This breaks the core value proposition of cloud sync. Users can't trust that the web app reflects their actual data after using bisync.