Skip to content

Code review comments on one notebook cell leak into other notebook cells as the Browser renderer reuses DOM which is not properly cleaned up #214585

@rehmsen

Description

@rehmsen
  • VS Code Version: vscode.dev/ (Browser code)
  • OS Version: Irrelevant

This is an issue with the browser code, which happens for code review comments on notebook cells. I do not have a public repro, but I can describe line by line why this happens, and am happy to send a PR to fix it:

I think we need to do the following to fix this issue:

  • CommentThreadWidget and its children (CommentThreadHeader) should remove the DOM elements they added to container when they are disposed(). That seems like good practice in general, and seems to be done at least in some other places in VSCode, e.g.
    container.appendChild(this.elements.root);
    this._register(toDisposable(() => this.elements.root.remove()));
  • CellComments should, instead of initializing only once, check if the ICellViewModel has changed in on didRender, and if so, run the same logic it runs onDidUpdateCommentThreads, which will remove, created, or update the comment thread.

I'll send a pull request to make this more concrete, happy to talk about other solutions to the problem, too.

@alexr00 @rebornix

Metadata

Metadata

Assignees

Labels

insiders-releasedPatch has been released in VS Code Insiders

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions