Skip to content

fix(nodes): guard missing roof-segment trim in ridge-vent geometry key (Sentry MONOREPO-EDITOR-ED)#530

Open
anton-pascal wants to merge 1 commit into
mainfrom
fix/sentry-EDITOR-ED
Open

fix(nodes): guard missing roof-segment trim in ridge-vent geometry key (Sentry MONOREPO-EDITOR-ED)#530
anton-pascal wants to merge 1 commit into
mainfrom
fix/sentry-EDITOR-ED

Conversation

@anton-pascal

@anton-pascal anton-pascal commented Jul 22, 2026

Copy link
Copy Markdown
Contributor

Summary

  • tolerate roof segments whose stored data predates the trim schema field
  • keep the ridge-vent geometry dependency key stable by reading trim fields from an empty partial object when segment.trim is missing

Root cause

The public viewer hydrates raw stored nodes without re-running the Zod parser. For legacy roof segments, that means the RoofSegmentTrim schema default never applies and segment.trim can be undefined at runtime. ridgeVentSegmentGeometryKey then dereferenced trim.left, crashing the viewer.

buildRidgeVentGeometry already routes trim handling through normalizeRoofSegmentTrim, so no additional guard was needed there.

Sentry

  • MONOREPO-EDITOR-ED
  • Issue 7593979332
  • Observed July 22, 2026 on /viewer/project_myTyG1YFgGBVpS6O

Validation

  • bun test packages/nodes/src/ridge-vent/__tests__/geometry.test.ts — 18 pass, 0 fail
  • bunx biome check packages/nodes/src/ridge-vent/renderer.tsx — clean

Note

Low Risk
Narrow defensive null-coalescing in a geometry cache key; no auth, data, or geometry-building logic changes beyond avoiding a runtime dereference.

Overview
Fixes a viewer crash when legacy roof segments are hydrated without a trim field (Zod defaults never run on raw stored nodes in the public viewer).

ridgeVentSegmentGeometryKey now treats missing segment.trim as an empty partial object before reading trim fields for the memo dependency string, so undefined trim no longer throws when building ridge-vent geometry keys.

Reviewed by Cursor Bugbot for commit 25b7add. Bugbot is set up for automated code reviews on this repo. Configure here.

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