<table><tr><td style="">dfaure created this revision.<br />dfaure added reviewers: ervin, dvratil.<br />Herald added a project: KDE PIM.<br />dfaure requested review of this revision.
</td><a style="text-decoration: none; padding: 4px 8px; margin: 0 8px 8px; float: right; color: #464C5C; font-weight: bold; border-radius: 3px; background-color: #F7F7F9; background-image: linear-gradient(to bottom,#fff,#f1f0f1); display: inline-block; border: 1px solid rgba(71,87,120,.2);" href="https://phabricator.kde.org/D18556">View Revision</a></tr></table><br /><div><strong>REVISION SUMMARY</strong><div><p>Fix tag name/type/gid missing in notifications about tags.</p>

<p>The logic in AggregatedFetchScope was wrong, it led to fetchIdOnly()<br />
being always true.</p>

<p>The mechanism in Aggregated* is all based on default_value || A || B || C<br />
where A, B, C are the boolean request from every subscriber.<br />
This works well for fetchRemoteId(), where the default_value is false.</p>

<p>For fetchIdOnly(), what we really want is "(A && B && C)" ("everyone<br />
wants fetchIdOnly) which was implemented as "!(A || B || C)"<br />
(the '!' in front is the == 0 instead of > 0 in Aggregated*FetchScope::fetchIdOnly()).</p>

<p>The flaw in this logic is the default value. With no subscribers,<br />
we want fetchIdOnly() == false, while it currently returns true.</p>

<p>A default_value of true in the default_value || A || B || C logic,<br />
can't work: the result was always true.</p>

<p>The solution I implemented is to compare the number of subscribers that<br />
called setFetchIdOnly(true) with the total number of subscribers.<br />
This directly implements A && B && C, with a default value of false.</p></div></div><br /><div><strong>TEST PLAN</strong><div><ol class="remarkup-list">
<li class="remarkup-list-item">extended tagstest. 2) this fixes the remaining failures in zanshin's akonadi tests.</li>
</ol></div></div><br /><div><strong>REPOSITORY</strong><div><div>R165 Akonadi </div></div></div><br /><div><strong>BRANCH</strong><div><div>Applications/18.12</div></div></div><br /><div><strong>REVISION DETAIL</strong><div><a href="https://phabricator.kde.org/D18556">https://phabricator.kde.org/D18556</a></div></div><br /><div><strong>AFFECTED FILES</strong><div><div>autotests/libs/tagtest.cpp<br />
src/core/tag.cpp<br />
src/server/aggregatedfetchscope.cpp<br />
src/server/aggregatedfetchscope.h<br />
src/server/notificationsubscriber.cpp</div></div></div><br /><div><strong>To: </strong>dfaure, ervin, dvratil<br /><strong>Cc: </strong>kde-pim, dvasin, rodsevich, winterz, vkrause, mlaurent, knauss, dvratil<br /></div>