snipe/app/db/migrations
pyr0ball 89d3862f62
Some checks failed
CI / Python tests (push) Has been cancelled
CI / Frontend typecheck + tests (push) Has been cancelled
Mirror / mirror (push) Has been cancelled
Release / release (push) Has been cancelled
feat(monitor): background saved-search monitoring with watch alerts (#12)
Backend:
- Migrations 013-015: eBay user tokens, monitor settings on saved_searches
  (monitor_enabled, poll_interval_min, min_trust_score, last_checked_at),
  watch_alerts table with UNIQUE dedup on (saved_search_id, platform_listing_id),
  active_monitors registry for cross-user polling
- WatchAlert model + store methods: upsert_alert, list_alerts, dismiss_alert,
  count_undismissed_alerts, dismiss_all_alerts, list_active_monitors
- monitor.py: run_monitor_search() using TrustScorer.score_batch(); should_alert()
  with BIN/auction/partial-score logic (auction window = 24h, partial +10 buffer)
- PATCH /api/saved-searches/{id}/monitor, GET /api/alerts, POST /api/alerts/*/dismiss
- Background polling loop at startup (asyncio.to_thread every 60s check cycle)
- ebay/adapter.py: enrich_seller_trading_api() via Trading API GetUser (OAuth token)
- nginx: raise proxy_read_timeout to 120s for slow eBay search responses

Frontend:
- AlertBell component: bell button + unread badge + panel with dismiss/clear-all;
  polls /api/alerts every 2 minutes; aria-live announcement on count change
- alerts.ts Pinia store: fetchAlerts, dismiss, dismissAll
- SavedSearchesView: monitor toggle + poll interval + min trust score controls
- SettingsView: eBay OAuth connect/disconnect section
- AppNav: AlertBell wired for logged-in and local-tier users

Tests: 24 monitor tests (should_alert branches, store alert CRUD, run_monitor_search
with mocked adapter); fix browser_pool test assertions for new wait_for_* params.
2026-05-04 08:24:56 -07:00
..
001_init.sql feat: add data models, migrations, and store 2026-03-25 13:08:55 -07:00
002_add_listing_format.sql feat(snipe): auction support + easter eggs (Konami, The Steal, de-emphasis) 2026-03-25 14:27:02 -07:00
003_nullable_account_age.sql fix: account_age_days=None for scraper tier, stop false new_account flags 2026-03-25 20:36:43 -07:00
004_staging_tracking.sql revert: remove ADD COLUMN IF NOT EXISTS (not a SQLite feature) 2026-04-05 22:24:06 -07:00
005_listing_category.sql revert: remove ADD COLUMN IF NOT EXISTS (not a SQLite feature) 2026-04-05 22:24:06 -07:00
006_scammer_blocklist.sql feat: scammer blocklist, search/listing UI overhaul, tier refactor 2026-04-03 19:08:54 -07:00
007_background_tasks.sql fix(tasks): address code review — cloud DB path, migration number, connection handling, enqueue site 2026-03-31 17:00:01 -07:00
008_community_signals.sql feat: snipe beta backlog batch (tickets #22/#28/#30/#34/#35/#36/#37/#38) 2026-04-13 19:32:50 -07:00
009_user_preferences.sql feat: snipe beta backlog batch (tickets #22/#28/#30/#34/#35/#36/#37/#38) 2026-04-13 19:32:50 -07:00
010_corrections.sql feat: wire community module + corrections router (#31 #32 #33) 2026-04-14 08:33:00 -07:00
011_ebay_categories.sql feat: add ebay_categories migration for LLM query builder category cache 2026-04-14 10:40:20 -07:00
012_reported_sellers.sql feat: reported sellers tracking + community blocklist opt-in 2026-04-16 13:28:57 -07:00
013_ebay_user_tokens.sql feat(monitor): background saved-search monitoring with watch alerts (#12) 2026-05-04 08:24:56 -07:00
014_saved_search_monitor.sql feat(monitor): background saved-search monitoring with watch alerts (#12) 2026-05-04 08:24:56 -07:00
015_active_monitors.sql feat(monitor): background saved-search monitoring with watch alerts (#12) 2026-05-04 08:24:56 -07:00