Skip to content

External modification detection never runs: check_quadlets() polls an always-empty table #283

Description

@karoltheguy

Overview

The sync engine's external-modification detection has silently never worked. It iterates
the quadlets table to decide which remote files to stat, and that table is never
written to, so every cycle inspects an empty set and reports nothing.

Details

Use Case / Steps:

  1. Register a server and let the sync poller run.
  2. Edit a Quadlet file directly on the remote host, outside QuadletManager.
  3. No external-modification is ever reported.

Expected vs Actual:

  • Expected: A Quadlet file changed outside the app is detected and surfaced.
  • Actual: Nothing is detected, for any file, on any server. The cycle completes
    successfully over an empty work set, so it looks healthy.

Details:

check_quadlets (services/sync_engine.py:166-246) starts from:

SELECT id, server_id, file_path, scope, last_known_mtime FROM quadlets

and groups the results into per-server mtime fetches. With zero rows there are no
groups, no tasks, and no findings. The last_known_mtime update path
(services/sync_engine.py:229) is likewise unreachable.

This is the same root cause as the Monitor glance-bar zeros reported in
#281, but a separate user-visible symptom, and it is pre-existing
rather than introduced by the recent Monitor work. Fixing the glance bar via a live
scan in the stats poller deliberately does not fix this, because it bypasses the table
rather than filling it.

Scope:

Decide whether the quadlets table should become a real persisted inventory (populated
from services/tree_scanner.py:fetch_all_quadlets, which today discards its results at
api/routes.py:548-563), or whether modification detection should also move to a live
scan. Then make detection actually run.

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions