Skip to content

Fix doubled projects after unchecking and checking again a data source

David Faure requested to merge work/dfaure/doubled_projects into master

by actually removing MonitorInterface::collectionSelectionChanged.

Calling collectionChanged() and collectionSelectionChanged() immediately afterwards leads to the following problem:

  • collectionChanged() => LiveQuery::result => doFetch => LiveQueryHelpers::fetchItems => CachingCollectionItemsFetchJob::start => delayed call to retrieveFromCache
  • collectionSelectionChanged() => LiveQuery::reset => clear() and doFetch() => fetchItems etc. same as above.

So when clear() is called, there's nothing to clear yet (fetching being delayed). And then both fetch jobs run and append all items twice.

There's a design issue with reset() while waiting for result(), which I'm not sure how to solve, but apparently removing collectionSelectionChanged() doesn't break anything, collectionChanged() is enough to react to selection (checked status) changes.

Merge request reports