fix: Sentry issues - #3109
Merged
Merged
Conversation
|
Some linked issues are invalid. Please update the issue links:\nIssue # in is not found or invalid (HTTP }404).\n |
|
|
Some linked issues are invalid. Please update the issue links:\nIssue # in is not found or invalid (HTTP }404).\n |
vivek-devtron
approved these changes
Aug 5, 2026
|
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.



Fixes https://github.com/devtron-labs/sprint-tasks/issues/2937
Description
Task: Sentry Issue
Cannot read properties of undefined (reading 'href')
https://devtron-a6.sentry.io/issues/7467835537/?project=6232011&query=is%3Aunresolved&referrer=issue-stream
Cannot read properties of undefined (reading 'resourceVersion')
https://devtron-a6.sentry.io/issues/7236985579/?project=6232011&query=is%3Aunresolved&referrer=issue-stream
Cannot read properties of undefined (reading 'from')
https://devtron-a6.sentry.io/issues/7472516589/?project=6232011&query=is%3Aunresolved&referrer=issue-stream
Cannot read properties of undefined (reading 'charAt')
Root cause: CodeEditorRenderer.tsx's diff-view effect (devtron-fe-common-lib/src/Shared/Components/CodeEditor/CodeEditorRenderer.tsx:244-256) destroyed the old CodeMirror MergeView whenever it reinitialized, but its unmount cleanup only nulled out the React refs/state without ever calling .destroy(). Any time a CodeEditor in diff mode (e.g. the CI/CD source-code tab) unmounted, its MergeView instance — and the DOM-level listeners it owns internally (revert-control button, hover tooltips, scroll sync) — kept running in the background. A later click anywhere in the app could trigger one of those orphaned listeners against a torn-down view, throwing Cannot read properties of undefined (reading 'charAt') from deep inside @codemirror/merge, which is why Sentry attributed it to the @code-editor bundle chunk even though the user was nowhere near a code editor at the time.
Fix: call .destroy() on both the merge view and the diff-minimap view in the cleanup function before discarding the refs, so they're properly torn down every time the component unmounts, not just when reinitializing.
This is in devtron-fe-common-lib, so it'll need to be built/published (or linked) before the dashboard picks it up — let me know if you want me to also bump/patch the dependency in dashboard/package.json, or if you're consuming it via a local link already.
Type of change
Checklist: