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

Keep track of deleted cell for reorder change request #12575

Merged
merged 1 commit into from
Jul 30, 2024

Conversation

dhruvmanila
Copy link
Member

@dhruvmanila dhruvmanila commented Jul 30, 2024

Summary

This PR fixes a bug where the server wouldn't retain the cell content in case of a reorder change request.

As mentioned in #12573 (comment), this change request is modeled as (a) remove these cell URIs and (b) add these cell URIs. The cell content isn't provided. But, the way we've modeled the NotebookCell (it contains the underlying TextDocument), we need to keep track of the deleted cells to get the content.

This is not an ideal solution and a better long term solution would be to model it as per the spec but that is a big structural change and will affect multiple parts of the server. Modeling as per the spec would also avoid bugs like #11864. For context, that model would add complexity per #11206 (comment).

fixes: #12573

Test Plan

This video shows the before and after the bug is fixed:

Screen.Recording.2024-07-30.at.15.09.11.mov

@dhruvmanila dhruvmanila added the bug Something isn't working label Jul 30, 2024
@MichaReiser
Copy link
Member

Uh that's a nasty bug. Nice find!

@dhruvmanila dhruvmanila enabled auto-merge (squash) July 30, 2024 09:47
@dhruvmanila dhruvmanila merged commit f3c14a4 into main Jul 30, 2024
19 checks passed
@dhruvmanila dhruvmanila deleted the dhruv/deleted-cell-content branch July 30, 2024 09:51
Copy link
Contributor

ruff-ecosystem results

Linter (stable)

✅ ecosystem check detected no linter changes.

Linter (preview)

✅ ecosystem check detected no linter changes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Linting on Jupyter Notebook fails after reordering cells
2 participants