Skip to content

fix(ensemble-manager): saving a region that already exists succeeds - #414

Merged
wmobley merged 1 commit into
developfrom
fix/em-region-existing
Nov 8, 2026
Merged

wmobley merged 1 commit into
developfrom
fix/em-region-existing

Conversation

@wmobley

@wmobley wmobley commented Nov 8, 2026

Copy link
Copy Markdown
Contributor

Submitting the same area twice from SUBSIDE fails at the region step (The region could not be saved, REGION_WRITE_FAILED). POST /regions inserts the region with its geometry row nested under it; when the region exists the insert hits ON CONFLICT DO NOTHING and Hasura refuses to insert the nested row ('cannot proceed to insert array relations ... affects zero rows'), the same error behind #411. insertRegionIfAbsent now treats it as already present and answers created: false, which is what the endpoint documents.

Tests: the region insert answers false on that error, true when a row is written, and still throws on any other error. npx jest src/classes/graphql src/api src/utils: 22 suites, 281 tests passed. tsc --noEmit clean.

🤖 Generated with Claude Code

POST /regions inserts the region with its geometry row nested under it. When
the region already exists (the same area submitted twice) the insert hits ON
CONFLICT DO NOTHING and Hasura refuses to insert the nested row, so the second
save failed with REGION_WRITE_FAILED instead of answering created: false.
insertRegionIfAbsent now treats that error as already present.
@vercel

vercel Bot commented Nov 8, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
monorepo Ready Ready Preview Nov 8, 2026 6:24pm UTC

@wmobley
wmobley merged commit ef466dd into develop Nov 8, 2026
40 checks passed

This branch was successfully deployed

1 active deployment
Preview — 19a52c8f Deployed Nov 8, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant