Repository navigation
fix: guard notebook diff input lifecycle - #339389
Merged
Dmitriy Vasyura (dmitrivMS) merged 2 commits intoOct 13, 2026
Merged
Dmitriy Vasyura (dmitrivMS) merged 2 commits into
Dmitriy Vasyura (dmitrivMS) merged 2 commits into
Conversation
Contributor
There was a problem hiding this comment.
Copilot review overview
🟡 Changes recommended
The new early-return paths can leave newly created webviews mounted and undisposed.
Review effort: Balanced
Findings: 1
Open (2)
What changed in this PR
Guards notebook diff editor setup against stale asynchronous input operations and resets navigation state during teardown.
Changes:
- Adds cancellation and input/model identity checks during setup.
- Resets the current-change index when clearing or detaching models.
- Adds lifecycle regression tests.
| File | Description |
|---|---|
notebookDiffEditor.ts |
Adds lifecycle guards and state resets. |
notebookDiffEditor.test.ts |
Tests clearing, replacement, and cancellation races. |
💡 Configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Dmitriy Vasyura (dmitrivMS)
enabled auto-merge (squash)
October 13, 2026 06:01
Collaborator
|
Simon Siefke (@SimonSiefke) Thank you! |
Dmitriy Vasyura (dmitrivMS)
approved these changes
Oct 13, 2026
Martin Aeschlimann (aeschli)
approved these changes
Oct 13, 2026
Aiday Marlen Kyzy (aiday-mar)
approved these changes
Oct 13, 2026
Simon Siefke (SimonSiefke)
deleted the
fix/notebook-diff-input-lifecycle
branch
October 13, 2026 09:40
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.


This PR is needed for #331805
Details
Closing or replacing a notebook diff input while it is opening can let the old
setInput()operation resume against a cleared or replacement model. The editor pane can also keep the previous input's current-change index when model detachment removes its focus listener before clearing the list.Change
Check cancellation and input/model identity after model resolution and each webview creation. Reset the current-change index to
-1when detaching a model or clearing an input.Validated with all 88 notebook-diff browser tests, including 10 deterministic lifecycle regression cases, focused ESLint, and the client TypeScript check.
AI disclosure: Model: GPT-6.1. Worktime: 5 min