ytptube/app/tests
Jesse Bate 0cb3a95a41 perf: batch item_updated WebSocket events into a single per-tick payload
The per-download 500ms throttle still scales linearly with concurrency:
N active downloads produce up to 2N item_updated frames per second, each
with its own serialization pass and per-client send.

Add an ItemBatcher at the WebSocket boundary that coalesces dirty items
by _id (last write wins) and emits one item_updated frame per 500ms
tick whose payload is always a list of items, even for a single update.
Leading-edge emits keep isolated updates (e.g. renames via the API)
instant, and a trailing flush at most 500ms later delivers the rest.
Pending items are flushed on shutdown before clients disconnect.

Emitter call sites, the EventBus, and the StatusTracker throttle are
unchanged; the batcher only changes the wire format. The frontend now
types item_updated as StoreItem[] and iterates the array.

BREAKING CHANGE: the item_updated WebSocket event payload (data) is now
always an array of items instead of a single item object.
2026-06-10 23:38:27 +09:30
..
helpers.py refactor: update terminal api 2026-04-29 22:25:39 +03:00
test_ag_utils.py refactor: made _static.py dynamic 2026-04-18 19:26:44 +03:00
test_async_url_validation_routes.py fix: respect sleep-requests arg in specific code paths. 2026-05-07 21:35:40 +03:00
test_backgroundworker.py improve logic for codec selection 2025-09-14 01:30:34 +03:00
test_cache.py chore: tests clean up 2026-05-04 22:23:19 +03:00
test_cf_solver_handler.py refactor: made _static.py dynamic 2026-04-18 19:26:44 +03:00
test_condition_ignore.py refactor: update test functions to use tmp_path for archive file handling 2026-05-08 21:56:41 +03:00
test_datastore.py feat: add YTP_MAX_HISTORY to cap history and prevent unbounded DB growth 2026-06-10 20:29:18 +09:30
test_datastore_pagination.py refactor: use one tmp directory for tests 2026-04-27 00:31:14 +03:00
test_download.py perf: throttle item_updated WebSocket events to 500ms intervals 2026-06-10 19:32:31 +09:30
test_download_utils.py refactor: update log mesages to take advantage of JSONL 2026-05-27 23:53:42 +03:00
test_encoder.py chore: tests clean up 2026-05-04 22:23:19 +03:00
test_events.py chore: tests clean up 2026-05-04 22:23:19 +03:00
test_extractor_timeout.py refactor: implement re-extraction logic and process-safe handling for non-picklable objects. 2026-05-25 20:06:34 +03:00
test_generic_browser.py fix: use yt-dlp meta extractors methods instead of local rolled ones 2026-05-08 21:39:12 +03:00
test_history_routes.py refactor: use item guid as thumbnail name for easier cleanup 2026-05-15 16:50:13 +03:00
test_httpx_client.py chore: tests clean up 2026-05-04 22:23:19 +03:00
test_images_routes.py feat: make log level runtime managable. 2026-05-28 21:26:23 +03:00
test_item_batcher.py perf: batch item_updated WebSocket events into a single per-tick payload 2026-06-10 23:38:27 +09:30
test_itemdto.py perf: exclude unused fields from ItemDTO list and WebSocket serialization 2026-06-10 20:09:13 +09:30
test_nfo_maker.py refactor: update test functions to use tmp_path for archive file handling 2026-05-08 21:56:41 +03:00
test_operations.py refactor: made _static.py dynamic 2026-04-18 19:26:44 +03:00
test_package_installer.py chore: tests clean up 2026-05-04 22:23:19 +03:00
test_router.py chore: tests clean up 2026-05-04 22:23:19 +03:00
test_scheduler.py chore: tests clean up 2026-05-04 22:23:19 +03:00
test_services.py chore: tests clean up 2026-05-04 22:23:19 +03:00
test_singleton.py Refactor: improve linting and formatting 2025-12-30 20:42:50 +03:00
test_sqlite_store.py chore: tests clean up 2026-05-04 22:23:19 +03:00
test_static_routes.py chore: tests clean up 2026-05-04 22:23:19 +03:00
test_system_routes.py perf: lazy-load folders on demand; remove queue from config endpoint 2026-06-10 20:07:19 +09:30
test_terminal_session_manager.py chore: tests clean up 2026-05-04 22:23:19 +03:00
test_test_helpers.py chore: tests clean up 2026-05-04 22:23:19 +03:00
test_update_checker.py chore: tests clean up 2026-05-04 22:23:19 +03:00
test_utils.py refactor: update log mesages to take advantage of JSONL 2026-05-27 23:53:42 +03:00