Skip to content
Verified Commit 679616d2 authored by Daniel Vrátil's avatar Daniel Vrátil 🤖
Browse files

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.
parent aa839a41
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment