From d427118bd91d67f1a041e5daf267aebcd34ca9d7 Mon Sep 17 00:00:00 2001 From: Christophe Besson Date: Tue, 25 Aug 2026 00:29:24 +0200 Subject: fix(node): scope _enriched_attempted by group, not just content hash MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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. --- packages/meshbay-node/tests/test_startup_scan_enrichment.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'packages/meshbay-node/tests/test_startup_scan_enrichment.py') 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") -- cgit v1.2.3