[Core] Fixed wrong order of widgets after sitemap changes #5523
Conversation
This partially reverts eclipse-archived#3846. fixes eclipse-archived#5522 Signed-off-by: Simon Kaufmann <simon.kfm@googlemail.com>
The SitemapSubscriptionService now gets informed by the SitemapProvider about a model change. Before, it was a matter of luck if the SitemapSubscriptionService or the SitemapProvider got informed first about a model change by the ModelRepository. If the SitemapSubscriptionService was so unlucky to be the first one, it got a stale model from the SitemapProvider and hence it again the calculation of the widget IDs was wrong. Signed-off-by: Simon Kaufmann <simon.kfm@googlemail.com>
While doing some manual testing, I realized that there is another potential source for wrong widget ID calculations: The |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for this bugfix. I can confirm that I can now change the sitemap on a running system and afterwards the assignments of widgets to items is correct again.
While implementing the sitemap reload feature I accidentally removed these two calls:
collectWidgets(sitemapName, pageId);
updateItemsAndWidgets(widgets);
which are necessary.
One small comment regarding the use of the public
keyword on interfaces.
* | ||
* @param listener | ||
*/ | ||
public void addModelChangeListener(ModelRepositoryChangeListener listener); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I know the other methods in this interface also have the public
keyword, but they are superfluous in an interface...
Signed-off-by: Simon Kaufmann <simon.kfm@googlemail.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, LGTM now.
…d#5523) * refresh internal widget collection on sitemap change * removed public modifiers from SitemapProvider interface * untangle model update notifiaction order The SitemapSubscriptionService now gets informed by the SitemapProvider about a model change. Before, it was a matter of luck if the SitemapSubscriptionService or the SitemapProvider got informed first about a model change by the ModelRepository. If the SitemapSubscriptionService was so unlucky to be the first one, it got a stale model from the SitemapProvider and hence it again the calculation of the widget IDs was wrong. This partially reverts eclipse-archived#3846. fixes eclipse-archived#5522 Signed-off-by: Simon Kaufmann <simon.kfm@googlemail.com>
This partially reverts #3846.
fixes #5522
Signed-off-by: Simon Kaufmann simon.kfm@googlemail.com