Skip to content

Files copied into a just-created project are missed until the next watcher reload #1817

Closed

Description

@phernandez

Edge case found during live testing of main at 0276799.

  1. create_memory_project on an empty folder (its creation scan finds 0 files).
  2. Copy files into the folder from outside, within watch_project_reload_interval (300s).
  3. The watcher picks up the new project on its next reload and from then on sees only new events. Files copied before that reload are never indexed until they change, bm reindex runs, or the server restarts.

Observed: assets copied at 18:42 were still missing at 18:47; a file dropped at 18:47 was indexed within 1s.

The normal flow, creating the project over a folder that already has files, works because the creation scan finds them. Possible low-cost fix: when a reload adds a project to the watch set, run an incremental scan for it, or have project creation trigger an immediate watcher reload.

Activity

  1. claude commented on Oct 23, 2026

    @claude
    Contributor

    Claude finished @phernandez's task in 28s —— View job


    Triage

    • Type: Enhancement (labeled enhancement). It could also be read as a bug, since files are silently never indexed, but the issue frames it as an edge case in the watcher design.

    • Component: Database/sync, specifically the watch service reload (watch_project_reload_interval) and project creation. No Cloud label.

    • Priority: Medium. Nothing is corrupted, and the files are still on disk. The window is narrow: create an empty project, then copy files in before the next reload. The missed files stay unindexed until they change, bm reindex runs, or the server restarts.

    • Complexity: Simple to Medium. Both options in the issue are small:

      1. When a reload adds a project to the watch set, run an incremental scan for it. This also covers projects added by other routes, such as config edits or another process.
      2. Make project creation trigger an immediate watcher reload. This narrows the window but doesn't close it, because files can still land between the creation scan and the watcher attaching.

      Option 1 is the more robust fix. The index is derived state that converges eventually, so the fix should stay lock-free. A regression test should cover the case where a file is copied into an empty project before the reload.

    • Duplicates: A search for related issues found none.

    No reproduction details are missing; the steps and timings are clear. This is triage only, so I haven't started an implementation.

  2. added 2 commits that reference this issue on Oct 25, 2026
    5695819
    9643ec2
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

    enhancementNew feature or request

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions