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

Handle cell execution cancellation because cell is disposed. #7555

Merged
merged 1 commit into from Nov 22, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
5 changes: 3 additions & 2 deletions packages/cells/src/widget.ts
Expand Up @@ -1108,8 +1108,9 @@ export namespace CodeCell {
}
return msg;
} catch (e) {
// If this is still the current execution, clear the prompt.
if (e.message === 'Canceled' && cell.outputArea.future === future) {
// If we started executing, and the cell is still indicating this
// execution, clear the prompt.
if (future && !cell.isDisposed && cell.outputArea.future === future) {
cell.setPrompt('');
}
throw e;
Expand Down
7 changes: 3 additions & 4 deletions packages/notebook/src/actions.tsx
Expand Up @@ -1555,11 +1555,10 @@ namespace Private {
}
})
.catch(reason => {
if (reason.message !== 'Canceled') {
throw reason;
if (cell.isDisposed || reason.message.startsWith('Canceled')) {
return false;
}

return false;
throw reason;
})
.then(ran => {
if (ran) {
Expand Down