File tree Expand file tree Collapse file tree
webapp/packages/core-connections/src Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -224,19 +224,33 @@ export class ConnectionInfoResource extends CachedMapResource<IConnectionInfoPar
224224 connectionInfoEventHandler . onEvent < ResourceKeyList < IConnectionInfoParams > > (
225225 ServerEventId . CbDatasourceUpdated ,
226226 key => {
227- if ( this . isConnected ( key ) && ! this . isOutdated ( key ) ) {
228- const connection = this . get ( key ) ;
227+ const connectedKey = resourceKeyList < IConnectionInfoParams > ( [ ] ) ;
228+ const disconnectedKey = resourceKeyList < IConnectionInfoParams > ( [ ] ) ;
229+
230+ for ( const connectionKey of key ) {
231+ if ( this . isConnected ( connectionKey ) ) {
232+ connectedKey . push ( connectionKey ) ;
233+ } else {
234+ disconnectedKey . push ( connectionKey ) ;
235+ }
236+ }
229237
230- this . dataSynchronizationService
231- . requestSynchronization ( 'connection' , connection . map ( connection => connection ?. name ) . join ( '\n' ) )
232- . then ( state => {
233- if ( state ) {
234- this . updateFromEvent ( key ) ;
235- }
236- } ) ;
237- } else {
238- this . updateFromEvent ( key ) ;
238+ if ( disconnectedKey . length > 0 ) {
239+ this . updateFromEvent ( disconnectedKey ) ;
239240 }
241+
242+ if ( connectedKey . length === 0 ) {
243+ return ;
244+ }
245+
246+ const connection = this . get ( connectedKey ) ;
247+ this . dataSynchronizationService
248+ . requestSynchronization ( 'connection' , connection . map ( connection => connection ?. name ) . join ( '\n' ) )
249+ . then ( state => {
250+ if ( state ) {
251+ this . updateFromEvent ( connectedKey ) ;
252+ }
253+ } ) ;
240254 } ,
241255 data =>
242256 resourceKeyList (
You can’t perform that action at this time.
0 commit comments