Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix notebook model/cell disposal #13606

Merged
merged 2 commits into from
Apr 15, 2024
Merged

Conversation

msujew
Copy link
Member

@msujew msujew commented Apr 15, 2024

What it does

Previously, when deleting a cell or a whole notebook, the deletion wasn't propagated to the documents-ext handler. Meaning that there was still a virtual document available in the plugin host for non-existing cell. This later on led to caching issues, for example accidentally executing outdated code cells.

Furthermore, closed notebooks didn't dispose their underlying model when the editor was closed. The model was always available in memory.

This change fixes the notebook document removal event and also simply deletes all cell documents from the plugin host.

How to test

  1. Set a breakpoint in here.
  2. Open a notebook document and delete a cell.
  3. Assert that the delta that is available in the debugger is a document deletion.
  4. Close the notebook document.
  5. All cells should now be removed from the documents.

Review checklist

Reminder for reviewers

@msujew msujew added the notebook issues related to notebooks label Apr 15, 2024
@msujew msujew requested a review from jonah-iden April 15, 2024 13:39
Copy link
Contributor

@jonah-iden jonah-iden left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the fix. Seems to work fine

@msujew msujew merged commit d99f81b into master Apr 15, 2024
14 checks passed
@msujew msujew deleted the msujew/remove-cells-plugin-host branch April 15, 2024 14:26
@github-actions github-actions bot added this to the 1.49.0 milestone Apr 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
notebook issues related to notebooks
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

2 participants