ETM: fix race condition during Collection population

Authored by dvratil on Mar 26 2020, 5:59 PM.

Description

ETM: fix race condition during Collection population

When populating Collections in ETM we may receive a "Collection added"
notification. If the Collection doesn't belong to an already-populated
subtree the code in ETMPrivate::retrieveAncestors() will try to iterate
through the chain of parent Collections to figure out which Collections
are missing and must be retrieved. However, Collections from the Monitor
notifications have only one parent set (the ancestor chain is not complete)
and so the code would get stuck.

This change makes retrieveAncestors() to handle the situation gracefuly
by fetching the entire ancestor chain from Akonadi recursively.

This got discovered by etmpopulationtest where the monitor likely
received a delayed notification that we sent during the initial
population of Akonadi by Knut resources.

Details

Committed
dvratilMar 26 2020, 6:05 PM
Parents
R165:aa839a413e23: Remove the outdated README file (there's README.md anyway)
Branches
Unknown
Tags
Unknown