snipe/tests
pyr0ball d5912080fb feat(search): async endpoint + SSE streaming for initial results
Add GET /api/search/async that returns HTTP 202 immediately and streams
scrape results via SSE to avoid nginx 120s timeouts on slow eBay searches.

Backend:
- New GET /api/search/async endpoint submits scraping to ThreadPoolExecutor
  and returns {session_id, status: "queued"} before scrape begins
- Background worker runs same pipeline as synchronous search, pushing
  typed SSE events: "listings" (initial batch), "update" (enrichment),
  "market_price", and None sentinel
- Existing GET /api/updates/{session_id} passes new event types through
  as-is (already a generic pass-through); deadline extended to 150s
- Module-level _search_executor (max_workers=4) caps concurrent scrape sessions

Frontend (search.ts):
- search() now calls /api/search/async instead of /api/search
- loading stays true until first "listings" SSE event arrives
- _openUpdates() handles new typed events: "listings", "market_price",
  "update"; legacy untyped enrichment events still handled
- cancelSearch() now also closes any open SSE stream

Tests: tests/test_async_search.py (6 tests) covering 202 response,
session_id registration in _update_queues, empty query path, UUID format,
and no-Chromium guarantee. All 159 pre-existing tests still pass.

Closes #49. Also closes Forgejo issue #1 (SSE enrichment streaming, already
implemented; async search completes the picture).
2026-04-20 10:57:32 -07:00
..
db feat: snipe beta backlog batch (tickets #22/#28/#30/#34/#35/#36/#37/#38) 2026-04-13 19:32:50 -07:00
platforms feat(search): normalize eBay listing + checkout URLs as item lookup 2026-04-20 10:49:17 -07:00
test_tasks feat: snipe beta backlog batch (tickets #22/#28/#30/#34/#35/#36/#37/#38) 2026-04-13 19:32:50 -07:00
trust test: aggregator coverage for zero_feedback, long_on_market, significant_price_drop 2026-04-16 13:14:20 -07:00
ui feat: snipe beta backlog batch (tickets #22/#28/#30/#34/#35/#36/#37/#38) 2026-04-13 19:32:50 -07:00
__init__.py feat: scaffold snipe repo 2026-03-25 13:08:54 -07:00
test_api_search_build.py feat: POST /api/search/build endpoint with tier gate and category cache wiring 2026-04-14 11:46:15 -07:00
test_async_search.py feat(search): async endpoint + SSE streaming for initial results 2026-04-20 10:57:32 -07:00
test_ebay_categories.py feat: community category federation in EbayCategoryCache.refresh() 2026-04-14 11:38:12 -07:00
test_feedback.py feat: preferences store, community signals, a11y + API fixes 2026-04-14 16:15:09 -07:00
test_query_translator.py feat: QueryTranslator with domain-aware system prompt and category hint injection 2026-04-14 11:43:19 -07:00
test_tiers.py feat: add llm_query_builder tier gate (paid+) to tiers.py and SessionFeatures 2026-04-14 11:44:53 -07:00