Skip to content

Fix global sync status blocking healthy projects from write operations #182

Closed

Description

@bm-claudeai

Bug Description

The current sync status system blocks ALL projects from write operations if ANY project has sync failures, breaking the intended project isolation in Basic Memory.

Problem

When any project has sync issues (e.g., "main" project with UNIQUE constraint failed), the global sync status prevents write operations in completely healthy projects.

Example Scenario

  1. Switch to healthy project: basic-memory-testing-20250626-1009 (✅ 6 entities, sync working)
  2. Try to create a note with write_note()
  3. Result: ❌ Sync failed for: main - Please wait for migration to complete before creating notes
  4. Expected: Note should be created successfully in the healthy project

Root Cause

In SyncStatusTracker._update_global_status():

if any(s == SyncStatus.FAILED for s in statuses):
    self._global_status = SyncStatus.FAILED  # Blocks ALL projects

The write_note tool checks global status instead of project-specific status:

migration_status = await wait_for_migration_or_return_status(timeout=5.0)
if migration_status:  # Returns error if ANY project failed
    return f"# System Status\n\n{migration_status}\n\nPlease wait for migration to complete before creating notes."

Impact

  • ❌ Breaks multi-project isolation
  • ❌ Prevents productive work in healthy projects
  • ❌ Poor user experience when unrelated projects have issues
  • ❌ Contradicts Basic Memory's design principle of project independence

Solution

Option 1: Project-Specific Ready Check (Recommended)

  • Add is_project_ready(project_name) method to SyncStatusTracker
  • Modify wait_for_migration_or_return_status() to check only active project
  • Update write_note, read_note, and build_context tools for project-specific checks

Option 2: Global Status Logic Fix

  • Change global status to only block when current active project has issues
  • Preserve safety while allowing healthy project operations

Expected Outcome

  • ✅ Users can work in healthy projects regardless of other project sync issues
  • ✅ Maintains proper isolation between projects
  • ✅ Preserves safety for projects that actually have sync problems
  • ✅ Improves overall user experience with multi-project setups

Priority

High - This significantly impacts usability in multi-project environments and breaks a core design principle.

Environment

  • Version: v0.13.8+
  • Multi-project setup with mixed sync states
  • Affects all write operations (write_note, edit_note, etc.)

Activity

  1. added this to the v0.14.0 milestone on Jun 26, 2025
  2. phernandez commented on Jun 26, 2025

    @phernandez
    Member

    fixed in #183

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions