Skip to content

fix: Sentry issues - #3109

Merged
shivani170 merged 7 commits into
developfrom
fix/sentry-bugs
Aug 5, 2026
Merged

fix: Sentry issues #3109
shivani170 merged 7 commits into
developfrom
fix/sentry-bugs

Conversation

@shivani170

@shivani170 shivani170 commented May 12, 2026

Copy link
Copy Markdown
Contributor

Fixes https://github.com/devtron-labs/sprint-tasks/issues/2937

Description

Task: Sentry Issue

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

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • This change requires a documentation update

Checklist:

  • The title of the PR states what changed and the related issues number (used for the release note).
  • Does this PR require documentation updates?
  • I've updated documentation as required by this PR.
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas

@github-actions

Copy link
Copy Markdown

Some linked issues are invalid. Please update the issue links:\nIssue # in is not found or invalid (HTTP }404).\n

@github-actions github-actions Bot added the PR:Issue-verification-failed PR:Issue-verification-failed label May 12, 2026
@shivani170 shivani170 self-assigned this May 12, 2026
@sonarqubecloud

Copy link
Copy Markdown

@github-actions

github-actions Bot commented Aug 4, 2026

Copy link
Copy Markdown

Some linked issues are invalid. Please update the issue links:\nIssue # in is not found or invalid (HTTP }404).\n

@github-actions github-actions Bot added PR:Ready-to-Review PR:Ready-to-Review and removed PR:Issue-verification-failed PR:Issue-verification-failed labels Aug 4, 2026
@shivani170 shivani170 changed the title fix: improve navigation safety checks and add redirect for legacy app… fix: Sentry issues Aug 5, 2026
@sonarqubecloud

sonarqubecloud Bot commented Aug 5, 2026

Copy link
Copy Markdown

@shivani170
shivani170 merged commit 368f94d into develop Aug 5, 2026
10 checks passed
@shivani170
shivani170 deleted the fix/sentry-bugs branch August 5, 2026 07:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

PR:Ready-to-Review PR:Ready-to-Review

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants