Skip to content

performanceTrackingUpdate recursion #9184

@andrewvarga

Description

@andrewvarga

I could have sworn I've mentioned this on a PR review recently but I can't find it..either way the issue still exists.

overrideTreeHighlighterUpdateForPerformanceTracking is called multiple times and wraps the original update function multiple times, causing this error after a while:

KclManager.ts:1211 CodeMirror plugin crashed: RangeError: Maximum call stack size exceeded
    at new _TreeNode (index.js:719:5)
    at get topNode (index.js:437:16)
    at _Tree.cursor (index.js:418:36)
    at highlightTree (index.js:329:33)
    at TreeHighlighter.buildDeco (index.js:1784:13)
    at TreeHighlighter.update (index.js:1775:37)
    at TreeHighlighter.performanceTrackingUpdate (KclManager.ts:1025:26)
    at TreeHighlighter.performanceTrackingUpdate (KclManager.ts:1025:26)
    at TreeHighlighter.performanceTrackingUpdate (KclManager.ts:1025:26)
    at TreeHighlighter.performanceTrackingUpdate (KclManager.ts:1025:26)

This can occur pretty easily when tweaking segments in sketch mode for a few minutes.
Regardless of the error, it's not nice to wrap this multiple times, markOnce is also dispatched many times.

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions