fix(realestate-notifier): preserve threshold=0 and test sent_ids retry path

- Replace `or 70` fallback with explicit None-check so that
  min_match_score=0 ("notify all matches") is no longer silently
  coerced to 70
- Add test: 200 OK + sent_ids=[] must not mark matches notified
- Add test: threshold=0 correctly pushes low-score matches

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-04-28 08:50:29 +09:00
parent 7aa7ccc6d5
commit c2939459e7
2 changed files with 41 additions and 1 deletions

View File

@@ -24,7 +24,8 @@ def notify_new_matches() -> dict:
if not profile.get("notify_enabled"):
return {"sent": 0, "skipped": "notify_disabled"}
threshold = profile.get("min_match_score") or 70
raw_threshold = profile.get("min_match_score")
threshold = 70 if raw_threshold is None else raw_threshold
matches = get_unnotified_matches(threshold)
if not matches:
return {"sent": 0}