fix: Use force_full=true for database sync after project sync/bisync

After rclone synchronizes files between local and cloud storage, the
database needs to perform a full scan to ensure it captures all changes.
Previously, incremental sync (watermark optimization) could miss files
that were changed remotely.

Changes:
- project sync command now calls /project/sync?force_full=true
- project bisync command now calls /project/sync?force_full=true
- Ensures complete database refresh after file synchronization

This guarantees the database is fully in sync with the filesystem
after any rclone sync or bisync operation.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
Signed-off-by: phernandez <paul@basicmachines.co>
This commit is contained in:
phernandez
2025-11-02 13:26:08 -06:00
parent c9946ecf1e
commit 2ad0ee9d5d
2 changed files with 6 additions and 9 deletions
@@ -1,10 +1,5 @@
"""Cloud bisync utility functions for Basic Memory CLI."""
import asyncio
import platform
import subprocess
import time
from datetime import datetime
from pathlib import Path
from basic_memory.cli.commands.cloud.api_client import make_api_request
+6 -4
View File
@@ -307,8 +307,6 @@ def remove_project(
if not delete_notes:
if local_path:
console.print(f"[yellow]Note: Local files remain at {local_path}[/yellow]")
else:
console.print("[yellow]Note: Cloud project files have not been deleted.[/yellow]")
except Exception as e:
console.print(f"[red]Error removing project: {str(e)}[/red]")
@@ -485,7 +483,9 @@ def sync_project_command(
async def _trigger_db_sync():
async with get_client() as client:
permalink = generate_permalink(name)
response = await call_post(client, f"/{permalink}/project/sync", json={})
response = await call_post(
client, f"/{permalink}/project/sync?force_full=true", json={}
)
return response.json()
try:
@@ -581,7 +581,9 @@ def bisync_project_command(
async def _trigger_db_sync():
async with get_client() as client:
permalink = generate_permalink(name)
response = await call_post(client, f"/{permalink}/project/sync", json={})
response = await call_post(
client, f"/{permalink}/project/sync?force_full=true", json={}
)
return response.json()
try: