@@ -70,7 +70,8 @@ import {
7070  setAuthEnabled , 
7171  setRetainCredentials , 
7272  updateConnection , 
73-   useDb 
73+   useDb , 
74+   getConnectedHost 
7475}  from  'shared/modules/connections/connectionsDuck' 
7576import  {  clearHistory  }  from  'shared/modules/history/historyDuck' 
7677import  {  backgroundTxMetadata  }  from  'shared/services/bolt/txMetadata' 
@@ -81,6 +82,7 @@ import {
8182import  {  isInt ,  Record  }  from  'neo4j-driver' 
8283import  semver ,  {  gte ,  SemVer  }  from  'semver' 
8384import  {  triggerCredentialsTimeout  }  from  '../credentialsPolicy/credentialsPolicyDuck' 
85+ import  {  isNonRoutingScheme  }  from  'services/boltscheme.utils' 
8486
8587async  function  databaseList ( store : any )  { 
8688  try  { 
@@ -166,16 +168,23 @@ async function getLabelsAndTypes(store: any) {
166168
167169async  function  getFunctionsAndProcedures ( store : any )  { 
168170  const  version  =  getSemanticVersion ( store . getState ( ) ) 
171+   const  supportsMultiDb  =  await  bolt . hasMultiDbSupport ( ) 
169172  try  { 
170173    const  procedurePromise  =  bolt . routedReadTransaction ( 
171174      getListProcedureQuery ( version ) , 
172175      { } , 
173-       backgroundTxMetadata 
176+       { 
177+         ...backgroundTxMetadata , 
178+         useDb : supportsMultiDb  ? SYSTEM_DB  : undefined 
179+       } 
174180    ) 
175181    const  functionPromise  =  bolt . routedReadTransaction ( 
176182      getListFunctionQuery ( version ) , 
177183      { } , 
178-       backgroundTxMetadata 
184+       { 
185+         ...backgroundTxMetadata , 
186+         useDb : supportsMultiDb  ? SYSTEM_DB  : undefined 
187+       } 
179188    ) 
180189    const  [ procedures ,  functions ]  =  await  Promise . all ( [ 
181190      procedurePromise , 
@@ -219,7 +228,10 @@ async function fetchServerInfo(store: any) {
219228    const  serverInfo  =  await  bolt . directTransaction ( 
220229      serverInfoQuery , 
221230      { } , 
222-       backgroundTxMetadata 
231+       { 
232+         ...backgroundTxMetadata , 
233+         useDb : ( await  bolt . hasMultiDbSupport ( ) )  ? SYSTEM_DB  : undefined 
234+       } 
223235    ) 
224236    store . dispatch ( updateServerInfo ( serverInfo ) ) 
225237  }  catch  { } 
@@ -301,10 +313,15 @@ export const dbMetaEpic = (some$: any, store: any) =>
301313        . merge ( some$ . ofType ( FORCE_FETCH ) ) 
302314        // Throw away newly initiated calls until done 
303315        . throttle ( ( )  =>  some$ . ofType ( DB_META_DONE ) ) 
316+         . do ( ( )  =>  { 
317+           // Cluster setups where the default database is unavailable, 
318+           // get labels and types takes a long time to finish and it shouldn't 
319+           // be blocking the rest of the bootup process, so we don't await the promise 
320+           getLabelsAndTypes ( store ) 
321+         } ) 
304322        . mergeMap ( ( )  => 
305323          Rx . Observable . fromPromise ( 
306324            Promise . all ( [ 
307-               getLabelsAndTypes ( store ) , 
308325              getFunctionsAndProcedures ( store ) , 
309326              clusterRole ( store ) , 
310327              databaseList ( store ) 
0 commit comments