diff options
| author | Christophe Besson <cbesson@gmail.com> | 2026-08-25 00:29:24 +0200 |
|---|---|---|
| committer | Christophe Besson <cbesson@gmail.com> | 2026-08-25 00:29:24 +0200 |
| commit | d427118bd91d67f1a041e5daf267aebcd34ca9d7 (patch) | |
| tree | ff9e0e71d4b115a871cf0902739942e6214b27d0 /packages/meshbay-node/tests/test_startup_scan_enrichment.py | |
| parent | 06c101154d544290d27f18d6fc08fb5f58a4e5d5 (diff) | |
| download | meshbay-0.7.tar.gz | |
fix(node): scope _enriched_attempted by group, not just content hash0.7
Major finding: entry.id is a content hash, so the exact same physical
file — the same MP3, byte-for-byte — indexed into two different groups
(a shared library reused across several demo/test groups, or genuinely
the same folder shared into two groups) produces the *same id* in both.
_enriched_attempted was a single flat set of bare ids shared across every
group this node hosts. The moment one group's copy got enriched, every
other group's otherwise-identical copy read as "already attempted" and
was skipped forever — nothing else ever revisits an id once it's in this
set. That group's Music tab (or Videos tab, same bug, same set) showed
every affected file at duration 0 with no artist/album/thumbnail,
permanently, no matter how long you waited or how many times you
reloaded — group A having been enriched first was enough to silently
starve every later group of the same content.
Now keyed by (group_id, entry.id) throughout — the enrichment gate, the
sweep, and the rename re-enrichment path, for both video and audio (they
already shared the one set, and the collision risk is identical for
both). New regression test constructs two groups with byte-identical
audio content and confirms both enrich independently.
Diffstat (limited to 'packages/meshbay-node/tests/test_startup_scan_enrichment.py')
| -rw-r--r-- | packages/meshbay-node/tests/test_startup_scan_enrichment.py | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/packages/meshbay-node/tests/test_startup_scan_enrichment.py b/packages/meshbay-node/tests/test_startup_scan_enrichment.py index cdadad9..65b9728 100644 --- a/packages/meshbay-node/tests/test_startup_scan_enrichment.py +++ b/packages/meshbay-node/tests/test_startup_scan_enrichment.py @@ -84,7 +84,7 @@ async def test_a_file_already_on_disk_at_startup_gets_enrichment_scheduled(tmp_p await asyncio.sleep(0.05) # let the coalescing timer fire _broadcast_index_change entry = next(iter(indexer.index.entries)) - assert entry.id in daemon._enriched_attempted, ( + assert ("a" * 32, entry.id) in daemon._enriched_attempted, ( "a file already on disk at startup must get enrichment scheduled the " "first time its group's index is broadcast, not only on a later " "watchdog-detected change to it") |