From 28e3aa3afa76060308e1d008a16306c15d7200b3 Mon Sep 17 00:00:00 2001 From: monfera Date: Thu, 14 Feb 2019 18:12:41 +0100 Subject: [PATCH] Fix: No longer break the user session upon encountering some race condition that doesn't impede layout management anyway --- x-pack/plugins/canvas/public/lib/aeroelastic_kibana.js | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/x-pack/plugins/canvas/public/lib/aeroelastic_kibana.js b/x-pack/plugins/canvas/public/lib/aeroelastic_kibana.js index 54ffd65db0d04..6a7034782baf8 100644 --- a/x-pack/plugins/canvas/public/lib/aeroelastic_kibana.js +++ b/x-pack/plugins/canvas/public/lib/aeroelastic_kibana.js @@ -16,9 +16,8 @@ export const aeroelastic = { }, createStore(initialState, onChangeCallback = () => {}, page) { - if (stores.has(page)) { - throw new Error('Only a single aeroelastic store per page should exist'); - } + // if due to a rare race condition, there's a preexisting store for a page, it's OK to just supersede it as + // the stale one just gets garbage collected (stores have only inert data and need no `destroy` calls etc.) stores.set(page, state.createStore(initialState, onChangeCallback));