You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
MONOREPO-EDITOR-MK — TypeError: Cannot read properties of undefined (reading 'join')
MONOREPO-EDITOR-MJ — related same-second downstream render failure; this change addresses the shared invalid-update path but does not claim a separate MJ fix.
Root cause
An invalid numeric node update correctly entered the sanitizer, but its warning formatter assumed every runtime NumericSanitizeIssue.path was an array and called .join() unconditionally. That made the error reporter throw inside updateNodesAction, masking the original schema-validation failure and aborting the remaining update batch. NumericSanitizeIssue.path is statically required, and all current sanitizeNumericValue call paths start from [] and extend with array spreads, so no reproducible in-source producer of an undefined path was found; the Sentry payload demonstrates the runtime invariant was nevertheless violated.
What changed
make numeric issue formatting tolerate null/undefined issue lists and missing/non-array paths, with a final non-throwing fallback
isolate both message construction and the warning sink so diagnostics can never interrupt node mutation
add regressions for missing paths and for a batched updateNodes call continuing after schema-invalid numeric data even when warning output throws
Verification
bun test packages/core/src/store/actions/node-mutation-sanitize.test.ts — PASS: 11 passed, 0 failed
bun biome lint packages/core/src/store/actions/node-actions.ts packages/core/src/store/actions/node-mutation-sanitize.test.ts — PASS: checked 2 files, no fixes applied
git diff --check — PASS
This is unverified against production traffic and needs review before merge.
Note
Low Risk
Localized to diagnostic logging around existing sanitization; behavior change is fail-safe continuation of mutations with added defensive formatting.
Overview
Hardens numeric sanitization warning formatting so bad diagnostic data cannot abort node create/update batches (fixes Sentry path.join on undefined).
numericSanitizeIssuesToMessage is exported and now accepts null/undefined issue lists, treats missing or non-array path as <unknown>, and falls back to <diagnostic unavailable> instead of throwing.
warnSanitizedNodeMutation wraps both message building and console.warn in try/catch so a broken formatter or logging sink never interrupts mutations.
Adds tests for defensive issue formatting and for updateNodes applying later updates when console.warn throws after an invalid numeric patch.
Reviewed by Cursor Bugbot for commit def7b31. Bugbot is set up for automated code reviews on this repo. Configure here.
Status note: this is still based on 27adf9a0, which is now 10 commits behindmain (34fbae74). The bug this fixes is still present on main — numericSanitizeIssuesToMessage still calls issue.path.map(String).join('.') with no array guard, so a malformed NumericSanitizeIssue still throws inside the error reporter and aborts updateNodesAction (MONOREPO-EDITOR-MK). GitHub reports this branch mergeable: true / clean, so it can still land, but the downstream app-side bump (pascalorg/private-editor#317) has gone stale: private-editor's submodule pointer moved to f90c7414, which is 7 commits ahead of this branch's head, so that bump would now roll the submodule backwards. I've converted #317 to draft. Cleanest path is to rebase this onto current main, land it, then re-point the submodule forward. Not rebasing unprompted — @Aymericr's call.
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
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.
Sentry issues
MONOREPO-EDITOR-MK—TypeError: Cannot read properties of undefined (reading 'join')MONOREPO-EDITOR-MJ— related same-second downstream render failure; this change addresses the shared invalid-update path but does not claim a separate MJ fix.Root cause
An invalid numeric node update correctly entered the sanitizer, but its warning formatter assumed every runtime
NumericSanitizeIssue.pathwas an array and called.join()unconditionally. That made the error reporter throw insideupdateNodesAction, masking the original schema-validation failure and aborting the remaining update batch.NumericSanitizeIssue.pathis statically required, and all currentsanitizeNumericValuecall paths start from[]and extend with array spreads, so no reproducible in-source producer of an undefined path was found; the Sentry payload demonstrates the runtime invariant was nevertheless violated.What changed
updateNodescall continuing after schema-invalid numeric data even when warning output throwsVerification
bun test packages/core/src/store/actions/node-mutation-sanitize.test.ts— PASS: 11 passed, 0 failedbun biome lint packages/core/src/store/actions/node-actions.ts packages/core/src/store/actions/node-mutation-sanitize.test.ts— PASS: checked 2 files, no fixes appliedgit diff --check— PASSThis is unverified against production traffic and needs review before merge.
Note
Low Risk
Localized to diagnostic logging around existing sanitization; behavior change is fail-safe continuation of mutations with added defensive formatting.
Overview
Hardens numeric sanitization warning formatting so bad diagnostic data cannot abort node create/update batches (fixes Sentry
path.joinon undefined).numericSanitizeIssuesToMessageis exported and now accepts null/undefined issue lists, treats missing or non-arraypathas<unknown>, and falls back to<diagnostic unavailable>instead of throwing.warnSanitizedNodeMutationwraps both message building andconsole.warnin try/catch so a broken formatter or logging sink never interrupts mutations.Adds tests for defensive issue formatting and for
updateNodesapplying later updates whenconsole.warnthrows after an invalid numeric patch.Reviewed by Cursor Bugbot for commit def7b31. Bugbot is set up for automated code reviews on this repo. Configure here.