gendesign/tradein-mvp/backend/app
lekss361 36df5d92d2 fix(tradein/avito): #487 BLOCK — mark_banned + defensive rollback (Option B)
deep-code-reviewer P0: mark_rate_limited() writes status='rate_limited' but
SQL CHECK constraint (015 + 051) only allows banned/done/failed/etc.
First blocking event would CheckViolation -> cascade through mark_failed ->
runs stuck in 'running' -> zombie cleanup. Frontend never shows badge.

Option B fix (no migration): rename mark_rate_limited -> mark_banned, use
existing 'banned' status (migration 015 doc'd as 'Avito вернул 403/captcha' -
exactly this scenario).

Plus:
- mark_failed + mark_banned now defensive db.rollback() at start (cascade-safe)
- All mark_* now RETURNING id + log warning when no rows updated (M3)
- Callers updated: scrape_pipeline.run_avito_city_sweep + test names

Refs PR #487 review (deep-code-reviewer, 2026-05-23).
2026-05-23 23:01:49 +03:00
..
api fix(tradein/avito): anti-bot hardening — sleep + abort + shared session 2026-05-23 23:00:23 +03:00
core feat(tradein): Phase 3.2 — /api/v1/search endpoint + Redis cache (#479) 2026-05-23 14:44:22 +00:00
schemas feat(tradein): in-app scheduler — UI-managed schedule (replaces SSH crontab) (#482) 2026-05-23 14:54:25 +00:00
services fix(tradein/avito): #487 BLOCK — mark_banned + defensive rollback (Option B) 2026-05-23 23:01:49 +03:00
tasks feat(tradein): search matview + indexes (Phase 3.1) (#469) 2026-05-23 14:01:18 +00:00
__init__.py feat: add tradein-mvp subproject (Trade-In Estimator под /trade-in) 2026-05-21 00:25:39 +03:00
main.py feat(tradein): in-app scheduler — UI-managed schedule (replaces SSH crontab) (#482) 2026-05-23 14:54:25 +00:00