From 75d1f8b93dfa0bffda3a59a6d143b06dcc3ca67f Mon Sep 17 00:00:00 2001 From: Christophe Besson Date: Mon, 24 Aug 2026 20:55:52 +0200 Subject: fix(node): skip indexing audio files under 50KB, likely-corrupt source MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The "P.H. Theme" failure investigated earlier turned out to be a genuinely corrupt 1256-byte source file with no audio stream at all, just an ID3 tag — a real, if rare, corruption pattern worth guarding against directly rather than only handling gracefully at playback time. Scoped to audio only, applied wherever a file actually gets hashed/typed (fresh scan and the cache-miss rehash path alike) — a tiny file of any other type is still indexed normally. --- packages/meshbay-node/tests/test_root_availability.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'packages/meshbay-node/tests/test_root_availability.py') diff --git a/packages/meshbay-node/tests/test_root_availability.py b/packages/meshbay-node/tests/test_root_availability.py index 028c308..0201c1f 100644 --- a/packages/meshbay-node/tests/test_root_availability.py +++ b/packages/meshbay-node/tests/test_root_availability.py @@ -14,6 +14,7 @@ straightforward implementation does. """ import asyncio +import os from pathlib import Path import pytest @@ -90,7 +91,10 @@ async def test_one_root_going_away_leaves_the_others_alone(tmp_path): films.mkdir() music.mkdir() (films / "a.mkv").write_bytes(b"a") - (music / "b.mp3").write_bytes(b"b") + # Above the tiny-audio-file cutoff (indexer.py's MIN_AUDIO_SIZE_BYTES) — + # this test is about root availability, not that gate, so the content + # just needs to actually get indexed as an entry. + (music / "b.mp3").write_bytes(os.urandom(60 * 1024)) idx = await _indexer(_roots(films, music)) assert _names(idx) == {"a.mkv", "b.mp3"} -- cgit v1.2.3