Repository navigation
[Codex] editor: preserve lot imports during hydration - #1188
Merged
Merged
Conversation
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What does this PR do?
Lot import now reads terrain before applying the parcel to the current scene. If hydration replaces the scene during the read, the final site keeps the resolved parcel, address, provenance, contours and terrain together, while preserving the hydrated site ID, setbacks, zone and unrelated metadata.
How to test
packages/editor, runbun test src/lib/lot/drop-in.test.ts src/lib/lot/lot-patch.test.ts src/lib/lot/terrain.test.ts: 33 tests passed. The new test pauses elevation, hydrates a starter site, then checks the actual parcel and preserved settings after the response.packages/editor, runtsgo --noEmit: passed locally.bun run check-typesand the required CI. The local whole-repo command reached 13 passing packages, but the standalone app could not resolve its WebXR, landscape and bath-space dependencies from the hosted checkout's different dependency tree.Screenshots / screen recording
N/A — non-visual change.
Checklist
bun devbun checkto verify)mainbranchAuthored by Codex. No provider calls or production writes were made during local verification.
Note
Medium Risk
Changes timing and single-write semantics for the shared lot import path used by multiple panels; behavior is covered by a new race test but async ordering regressions could still affect real imports.
Overview
Lot drop-in no longer writes the resolved parcel to the scene before the USGS elevation call finishes. Terrain is sampled first (without touching the store), then the current site is read again and parcel geometry, address, contours, and terrain are committed in one patch.
This closes a race where scene hydration (or a user edit) could replace the site while providers were still in flight—the old flow could leave a starter polygon or miss terrain on the hydrated site ID.
sitePatchFromParcelstill runs against the live site so owner setbacks, zone, and unrelated metadata stay intact while parcel facts update.Adds a test that blocks elevation, hydrates a custom site mid-drop, and asserts the Gainesville parcel, terrain, and preserved settings land on that site.
Reviewed by Cursor Bugbot for commit d2054f2. Bugbot is set up for automated code reviews on this repo. Configure here.