[jbosstools-issues] [JBoss JIRA] (JBIDE-21828) OpenShift Explorer view flickers when refreshing a service

Viacheslav Kabanovich (JIRA) issues at jboss.org
Tue Mar 8 15:58:00 EST 2016


    [ https://issues.jboss.org/browse/JBIDE-21828?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13173868#comment-13173868 ] 

Viacheslav Kabanovich commented on JBIDE-21828:
-----------------------------------------------

One more thought. Now, the content provider for Explorer is playing the role of the model that manages loading so that any time when viewer refresh triggered loading, events from the loading need to call refresh of viewer but it may cause looping. 

The solution is to separate the model entirely from the content provider. Model should live independently and 
- fulfil queries of its clients one of which is the content provider;
- refresh itself when requested in the manner I described in my previous comment;
-  send events to clients. 

The content provider will always receive the current state of model, when the model finds that an object is to loaded, it may put a flags on it like isOutOfSync(), isLoading(), etc, and execute 
- loading _new_ substructure; 
-  merge to _current_ substructure; 
- firing _one_ event with tree of changes. 

Meanwhile, the content provider seeing that the object for which it is requested by the viewer to provide children, has isOutOfSync() = true or isLoading() = true, may return at its own discretion a fake node 'Loading...'; the label provider may in some way mark 'out of sync' nodes; action handlers can check it and warn user in a message dialog, etc. Finally, when _one_ event comes from the model, the tree viewer will refresh itself from the most top node affected, receiving again the _current_ structure of the model, probably with some more nodes out of sync and/or loading, if in the mean time the local model  got new change events from the remote model.



> OpenShift Explorer view flickers when refreshing a service
> ----------------------------------------------------------
>
>                 Key: JBIDE-21828
>                 URL: https://issues.jboss.org/browse/JBIDE-21828
>             Project: Tools (JBoss Tools)
>          Issue Type: Bug
>          Components: openshift
>    Affects Versions: 4.3.1.Beta2
>            Reporter: Xavier Coulon
>         Attachments: Screenshot 2016-03-08 10.32.39.png
>
>
> When calling the "Refresh" command on a service, the tree view flickers because of too many refresh calls.
> Adding some traces revealed 25 calls to {{BaseExplorerContentProvider#refreshViewer(Object)}}, which seems way too much for a service with a single pod.
> Attachement: screenshot of the OpenShift Server view, showing 2 projects, one of which has 3 services.
> Custom/added logs in the console:
> {code}
> Refreshing viewer from org.jboss.tools.openshift.internal.ui.models.OpenShiftProjectUIModel at 431dafbc
> Refreshing viewer from org.jboss.tools.openshift.internal.ui.models.OpenShiftProjectUIModel at 431dafbc
> Refreshing viewer from org.jboss.tools.openshift.internal.ui.models.OpenShiftProjectUIModel at 431dafbc
> Refreshing viewer from org.jboss.tools.openshift.internal.ui.models.OpenShiftProjectUIModel at 431dafbc
> Refreshing viewer from org.jboss.tools.openshift.internal.ui.models.OpenShiftProjectUIModel at 431dafbc
> Refreshing viewer from org.jboss.tools.openshift.internal.ui.models.OpenShiftProjectUIModel at 431dafbc
> Refreshing viewer from sample/jee-sample
> Refreshing viewer from sample/jee-sample
> Refreshing viewer from sample/jee-sample
> Refreshing viewer from sample/jee-sample
> Refreshing viewer from sample/mongodb
> Refreshing viewer from sample/mongodb
> Refreshing viewer from sample/mongodb
> Refreshing viewer from sample/nodejs-mongodb-example
> Refreshing viewer from sample/nodejs-mongodb-example
> Refreshing viewer from sample/nodejs-mongodb-example
> Refreshing viewer from sample/nodejs-mongodb-example
> Refreshing viewer from sample/jee-sample
> Refreshing viewer from sample/jee-sample
> Refreshing viewer from sample/jee-sample
> Refreshing viewer from sample/jee-sample
> Refreshing viewer from sample/nodejs-mongodb-example
> Refreshing viewer from sample/nodejs-mongodb-example
> Refreshing viewer from org.jboss.tools.openshift.internal.ui.models.OpenShiftProjectUIModel at 431dafbc
> Refreshing viewer from org.jboss.tools.openshift.internal.ui.models.OpenShiftProjectUIModel at 431dafbc
> {code}



--
This message was sent by Atlassian JIRA
(v6.4.11#64026)


More information about the jbosstools-issues mailing list