mirror of
https://github.com/weaveworks/scope.git
synced 2026-03-04 18:51:17 +00:00
Reset nodes in frontend when scope-app restarted
When the scope-app restarts, it no longer has a reference to the previous node set. Therefore, the delta update adds *all* nodes but does not remove legacy ones. `reset==true` tells the frontend to start fresh. Fixes #2708
This commit is contained in:
@@ -551,7 +551,7 @@ export function receiveNodesDelta(delta) {
|
||||
dispatch({ type: ActionTypes.FINISH_TIME_TRAVEL_TRANSITION });
|
||||
}
|
||||
|
||||
const hasChanges = delta.add || delta.update || delta.remove;
|
||||
const hasChanges = delta.add || delta.update || delta.remove || delta.reset;
|
||||
if (hasChanges) {
|
||||
dispatch({
|
||||
type: ActionTypes.RECEIVE_NODES_DELTA,
|
||||
|
||||
@@ -582,7 +582,12 @@ export function rootReducer(state = initialState, action) {
|
||||
log('RECEIVE_NODES_DELTA',
|
||||
'remove', size(action.delta.remove),
|
||||
'update', size(action.delta.update),
|
||||
'add', size(action.delta.add));
|
||||
'add', size(action.delta.add),
|
||||
'reset', action.delta.reset);
|
||||
|
||||
if (action.delta.reset) {
|
||||
state = state.set('nodes', makeMap());
|
||||
}
|
||||
|
||||
// remove nodes that no longer exist
|
||||
each(action.delta.remove, (nodeId) => {
|
||||
|
||||
Reference in New Issue
Block a user