From 2ad0ee9d5dd7405fff0b0a922d2461ebe8b0f208 Mon Sep 17 00:00:00 2001 From: phernandez Date: Sun, 2 Nov 2025 13:26:08 -0600 Subject: [PATCH] fix: Use force_full=true for database sync after project sync/bisync MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 Signed-off-by: phernandez --- src/basic_memory/cli/commands/cloud/bisync_commands.py | 5 ----- src/basic_memory/cli/commands/project.py | 10 ++++++---- 2 files changed, 6 insertions(+), 9 deletions(-) diff --git a/src/basic_memory/cli/commands/cloud/bisync_commands.py b/src/basic_memory/cli/commands/cloud/bisync_commands.py index 2e8a8374..c7ad9139 100644 --- a/src/basic_memory/cli/commands/cloud/bisync_commands.py +++ b/src/basic_memory/cli/commands/cloud/bisync_commands.py @@ -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 diff --git a/src/basic_memory/cli/commands/project.py b/src/basic_memory/cli/commands/project.py index c15347ba..b1918c85 100644 --- a/src/basic_memory/cli/commands/project.py +++ b/src/basic_memory/cli/commands/project.py @@ -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: