-
Notifications
You must be signed in to change notification settings - Fork 30.1k
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
Notebook Diff Viewer does not reflect true state of ipynb (JSON contents) #207968
Comments
Easier way to explain the bug
|
Suggested Solution
|
@rebornix /cc |
Considering that a serialize operation should not have side effects (ideally), enforcing a "save participant" from ipynb extension makes very good sense to me. We can leverage vscode/extensions/ipynb/src/notebookAttachmentCleaner.ts Lines 83 to 108 in 9f25e63
|
For such critical metadata change, we might want to handle both auto save and manual save as we want the json and model to be always in sync. |
Another simple repro step
Again, model does not contain metadta (as this is a new cell) and ipynb JSON contains metadata when serialized. |
Internal NotesHere's the work flow
Problems
|
javascript
Update Cell Language
Bug
{custom: metadata: vscode: languageId: "javascript"...
This is incorrect. The ipynb has the above metadata.
What seems to be happening is
I.e. model change triggered => ipynb serialize to JSON => Json contains new metadtaa not in model => Missing step is to update the model again
If we implement the last step, we could always end up in an infinite loop,
Perhaps we should first update the model with metadata when ever we detect chagnes in the model before the save event.
E.g. as part of pre-Save (onDidChangeNotebookDocument &/or onWillSaveNotebookDocument)
This way, model will always be accurate and upto date when ipynb is serialized.
The text was updated successfully, but these errors were encountered: