diff options
| author | Christophe Besson <cbesson@gmail.com> | 2026-08-24 20:55:52 +0200 |
|---|---|---|
| committer | Christophe Besson <cbesson@gmail.com> | 2026-08-24 20:55:52 +0200 |
| commit | 75d1f8b93dfa0bffda3a59a6d143b06dcc3ca67f (patch) | |
| tree | 7c4662b8a0e7d0d591f9b9a7e1bc9a83beb578f8 /packages/meshbay-node/tests/test_root_availability.py | |
| parent | 6c56877675958e40ae526e0965266ab68aae44f2 (diff) | |
| download | meshbay-75d1f8b93dfa0bffda3a59a6d143b06dcc3ca67f.tar.gz | |
fix(node): skip indexing audio files under 50KB, likely-corrupt source
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.
Diffstat (limited to 'packages/meshbay-node/tests/test_root_availability.py')
| -rw-r--r-- | packages/meshbay-node/tests/test_root_availability.py | 6 |
1 files changed, 5 insertions, 1 deletions
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"} |