From fa8feed249edeaf668c91d6c7018666415c1dc7e Mon Sep 17 00:00:00 2001 From: Rich Chiodo Date: Wed, 5 Feb 2020 14:50:06 -0800 Subject: [PATCH 1/2] Make sure to clear variable list on reset --- .../interactive-common/redux/reducers/variables.ts | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/datascience-ui/interactive-common/redux/reducers/variables.ts b/src/datascience-ui/interactive-common/redux/reducers/variables.ts index f48cf215b90a..caeb3e76006d 100644 --- a/src/datascience-ui/interactive-common/redux/reducers/variables.ts +++ b/src/datascience-ui/interactive-common/redux/reducers/variables.ts @@ -22,7 +22,7 @@ type VariableReducerFunc = ReducerFunc = ReducerArg; function handleRequest(arg: VariableReducerArg): IVariableState { - const newExecutionCount = arg.payload.executionCount ? arg.payload.executionCount : arg.prevState.currentExecutionCount; + const newExecutionCount = arg.payload.executionCount !== undefined ? arg.payload.executionCount : arg.prevState.currentExecutionCount; arg.queueAction( createPostableAction(InteractiveWindowMessages.GetVariablesRequest, { executionCount: newExecutionCount, @@ -108,7 +108,12 @@ function handleResponse(arg: VariableReducerArg): IVa function handleRestarted(arg: VariableReducerArg): IVariableState { // If the variables are visible, refresh them if (arg.prevState.visible) { - return handleRequest({ ...arg, payload: { executionCount: 0, sortColumn: 'name', sortAscending: true, startIndex: 0, pageSize: arg.prevState.pageSize } }); + const result = handleRequest({ ...arg, payload: { executionCount: 0, sortColumn: 'name', sortAscending: true, startIndex: 0, pageSize: arg.prevState.pageSize } }); + return { + ...result, + currentExecutionCount: 0, + variables: [] + }; } return arg.prevState; } From 27830ac06ec81c842b9ab087d8417692ed49270e Mon Sep 17 00:00:00 2001 From: Rich Chiodo Date: Wed, 5 Feb 2020 14:51:00 -0800 Subject: [PATCH 2/2] Add news entry --- news/2 Fixes/9740.md | 1 + 1 file changed, 1 insertion(+) create mode 100644 news/2 Fixes/9740.md diff --git a/news/2 Fixes/9740.md b/news/2 Fixes/9740.md new file mode 100644 index 000000000000..30bb6f62d107 --- /dev/null +++ b/news/2 Fixes/9740.md @@ -0,0 +1 @@ +Make sure to clear variable list on restart kernel. \ No newline at end of file