eclipse-theia / theia

Eclipse Theia is a cloud & desktop IDE framework implemented in TypeScript.
http://theia-ide.org
Eclipse Public License 2.0
19.84k stars 2.48k forks source link

Improve notebook cell model lifecycle #13675

Closed msujew closed 3 months ago

msujew commented 3 months ago

What it does

After https://github.com/eclipse-theia/theia/issues/13488, I've noticed a few issues in incorrect caching of notebook cells. Mostly related to them staying in storage for too long, thereby overriding new cells. This is mostly related to:

How to test

I've been pretty successful in reproducing the behavior on master by:

  1. Opening an existing notebook file
  2. Adding a few new code cells to the start of the file
  3. Closing the notebook file again
  4. Opening it again

On master the new code cells contain content of other, existing code cells (this seems to happen almost at random, though it is consistent). This change should produce empty cells after opening the notebook again.

Furthermore, reviewers should test that cell execution on newly created cells works as expected (to test the newly added call to $acceptEditorsAndDocumentsDelta).

Review checklist

Reminder for reviewers

msujew commented 3 months ago

@jonah-iden good catch! I actually already broke this in https://github.com/eclipse-theia/theia/pull/13606, but it should be fixed now.