gendesign/tradein-mvp/backend/app/services
lekss361 872c83caf5 fix(tradein-estimator): atomic IMV link, batched yandex history, drop redundant CAST
3 fixes inside services/estimator.py from 2026-05-24 audit:

* IMV link UPDATE moved inside main tx (finding #4) — closes race where two
  concurrent estimates sharing a cache_key could overwrite each other's
  estimate_id after the main commit.
* _save_yandex_history_items batched under single try/except (finding #5) —
  prior per-item db.rollback() destroyed the parent transaction; next
  iteration could run on a rolled-back session.
* Drop redundant CAST inside IS NOT NULL predicates in _fetch_analogs
  (finding #9) — CAST(NULL AS T) IS NOT NULL is equivalent to NULL IS NOT NULL
  but evaluates per-row. THEN-branch CASTs preserved (typed arithmetic).

test: update test_save_history_items_db_error_continues → batch rollback semantics
2026-05-24 14:01:02 +03:00
..
exporters fix(tradein): security hotfix — C-3 config default + C-4 empty estimate persist + C-6 PDF URL allowlist (#435) 2026-05-23 09:38:23 +00:00
matching fix(tradein-matching): pg_advisory_xact_lock to prevent duplicate house INSERTs (#501) 2026-05-24 10:52:10 +00:00
scrapers fix(tradein-avito): strip Emotion CSS from listings.address (#502) 2026-05-24 10:52:50 +00:00
__init__.py feat: add tradein-mvp subproject (Trade-In Estimator под /trade-in) 2026-05-21 00:25:39 +03:00
brand.py feat: add tradein-mvp subproject (Trade-In Estimator под /trade-in) 2026-05-21 00:25:39 +03:00
cache.py feat(tradein): Phase 3.2 — /api/v1/search endpoint + Redis cache (#479) 2026-05-23 14:44:22 +00:00
cian_session.py fix(tradein): CIAN_REQUIRED_COOKIES — add real auth cookies (DMIR_AUTH + Cian session) (#480) 2026-05-23 14:52:24 +00:00
estimator.py fix(tradein-estimator): atomic IMV link, batched yandex history, drop redundant CAST 2026-05-24 14:01:02 +03:00
geocoder.py feat(tradein): postgres_fdw live read of gendesign.cad_buildings (replaces snapshot) (#493) 2026-05-24 08:57:30 +00:00
house_metadata.py feat(tradein): postgres_fdw live read of gendesign.cad_buildings (replaces snapshot) (#493) 2026-05-24 08:57:30 +00:00
scheduler.py feat(tradein): in-app scheduler — UI-managed schedule (replaces SSH crontab) (#482) 2026-05-23 14:54:25 +00:00
scrape_pipeline.py fix(tradein/avito): anti-bot hardening — sleep + abort + shared session (#487) 2026-05-23 20:08:40 +00:00
scrape_runs.py fix(tradein/avito): anti-bot hardening — sleep + abort + shared session (#487) 2026-05-23 20:08:40 +00:00
scraper_settings.py feat(tradein): global scraper delay setting (applies across all scrapers) (#485) 2026-05-23 15:43:28 +00:00
search_query.py feat(tradein): Phase 3.2 — /api/v1/search endpoint + Redis cache (#479) 2026-05-23 14:44:22 +00:00