Skip to content

fix: resolve Sentry errors BD, BE, 9E#323

Open
anton-pascal wants to merge 1 commit into
mainfrom
fix/sentry-BD-BE
Open

fix: resolve Sentry errors BD, BE, 9E#323
anton-pascal wants to merge 1 commit into
mainfrom
fix/sentry-BD-BE

Conversation

@anton-pascal
Copy link
Copy Markdown
Contributor

@anton-pascal anton-pascal commented May 21, 2026

Fixes Sentry errors where cursorGroupRef.current and wallPreviewRef.current are read as null during placement-coordinator and wall-tool event handlers.

Sentry impact (live as of 2026-05-27 04:00 UTC nightly triage):

  • MONOREPO-EDITOR-BCCannot read properties of null (reading 'rotation')53,478 events since 2026-05-20
  • MONOREPO-EDITOR-BD — same family — 403 events since 2026-05-20
  • MONOREPO-EDITOR-BECannot set properties of null (setting 'visible') in wall-tool — handled by the wall/tool.tsx hunk
  • MONOREPO-EDITOR-9E — same family

Root cause. mitt dispatches synchronously by mapping over a snapshot of the listener set, so a handler can still run after the cleanup function has called emitter.off(...) if the emit is already in flight. By that point React has already unmounted the <group ref={cursorGroupRef}> / <mesh ref={wallPreviewRef}>, so *.current is null and any .rotation / .visible write throws.

Fix. Defensive if (!ref.current) return early-return at the top of every grid/wall/item/ceiling on* handler, plus optional-chain on the two read sites that need a fallback (cursorGroupRef.current?.rotation.y ?? 0).

Two files, +31 / -6 lines:

  • packages/editor/src/components/tools/item/use-placement-coordinator.tsx
  • packages/nodes/src/wall/tool.tsx

Rebased onto current main 2026-05-27 04:30 UTC; wall/tool.tsx conflict (HEAD added a double-click guard, this branch added the null-ref guard) resolved to keep both. bun run check clean on the touched files.

The single failing check is the cosmetic Mintlify docs preview, unrelated to this code.

🤖 Authored by Anton (Pascal AI assistant). Diagnosis written up in memory/sentry-triage/2026-05-27.md.

@mintlify
Copy link
Copy Markdown

mintlify Bot commented May 21, 2026

Preview deployment for your docs. Learn more about Mintlify Previews.

Project Status Preview Updated (UTC)
pascal 🔴 Failed May 21, 2026, 4:08 AM

💡 Tip: Enable Workflows to automatically generate PRs for you.

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