fix(analyze): cad_exists_in_db requires non-NULL geometry #1034

Merged
bot-backend merged 1 commit from fix/cad-exists-null-geom into main 2026-06-03 15:00:07 +00:00
Collaborator

Дополняет NULL-geom 500-фикс. cad_exists_in_db (docstring «есть ли GEOMETRY») проверял только наличие строки, не geom IS NOT NULL → для ~964 meta-but-null-geom участков врал True. После 500-фикса такой участок шёл в fallback, find_or_enqueue_fetch шаг 2 видел cad_exists=True → ("ready", None) → NSPD-fetch НЕ ставился → analyze зацикливался в 202 job_id=null навсегда (геометрия не подтягивалась). Фикс: AND geom IS NOT NULL во все 3 EXISTS-ветки → null-geom → fetch ставится (202 + реальный job_id) → геометрия приходит → analyze работает (или 404). Valid-geom не затронут. 37 тестов зелёные. Refs #944.

**Дополняет NULL-geom 500-фикс.** `cad_exists_in_db` (docstring «есть ли GEOMETRY») проверял только наличие строки, не `geom IS NOT NULL` → для ~964 meta-but-null-geom участков врал True. После 500-фикса такой участок шёл в fallback, `find_or_enqueue_fetch` шаг 2 видел cad_exists=True → `("ready", None)` → NSPD-fetch НЕ ставился → analyze зацикливался в **202 job_id=null навсегда** (геометрия не подтягивалась). Фикс: `AND geom IS NOT NULL` во все 3 EXISTS-ветки → null-geom → fetch ставится (202 + реальный job_id) → геометрия приходит → analyze работает (или 404). Valid-geom не затронут. 37 тестов зелёные. Refs #944.
bot-backend added 1 commit 2026-06-03 15:00:03 +00:00
fix(analyze): cad_exists_in_db must require non-NULL geometry
All checks were successful
Deploy / build-backend (push) Successful in 2m34s
Deploy / deploy (push) Successful in 2m11s
Deploy / changes (push) Successful in 6s
Deploy / build-frontend (push) Has been skipped
Deploy / build-worker (push) Successful in 3m10s
85c43ff68b
Complements the NULL-geom 500 fix. cad_exists_in_db (docstring: "is there
GEOMETRY") checked only row existence, not geom IS NOT NULL — so for the ~964
meta-but-NULL-geom parcels it returned True. Consequence after the 500 fix:
such a parcel fell into the analyze fallback, find_or_enqueue_fetch step 2 saw
cad_exists_in_db=True → returned ("ready", None) → NO NSPD fetch enqueued →
analyze looped to a 202 with job_id=null and the parcel was stuck "fetching"
forever (never pulled real geometry, never resolved).

Fix: add `AND geom IS NOT NULL` to all three EXISTS branches (aligns the
function with its docstring). Now a NULL-geom parcel → cad_exists_in_db=False →
a real NSPD fetch is enqueued (202 + real job_id) → geometry populates →
re-poll → analyze succeeds (or 404 not_in_nspd if NSPD lacks it). No more
stuck-202. Valid-geom parcels unaffected. All 3 callers want geometry-presence
semantics. 37 analyze/fetch/by-bbox tests green. Refs #944.
bot-backend merged commit 85c43ff68b into main 2026-06-03 15:00:07 +00:00
bot-backend deleted branch fix/cad-exists-null-geom 2026-06-03 15:00:07 +00:00
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: lekss361/gendesign#1034
No description provided.