Try and see if we can trigger both addressbook and contacts sync in one go
You're doing
//Sync Addressbooks
Sink::SyncScope scope1;
scope1.setType<Addressbook>();
scope1.resourceFilter(mResourceInstanceIdentifier);
Store::synchronize(scope1).exec().waitForFinished();
And then flushing of message queue and similarly for contacts
//Sync Contacts
Sink::SyncScope scope2;
scope2.setType<Sink::ApplicationDomain::Contact>();
scope2.resourceFilter(mResourceInstanceIdentifier);
Store::synchronize(scope2).exec().waitForFinished();
Quick look at test code from sink repository,
It seems to be doing,
Sink::SyncScope scope;
scope.resourceFilter(mResourceInstanceIdentifier);
VERIFYEXEC(Sink::Store::synchronize(scope));
Which gives me feeling that, in general we can avoid two different syncs, and we can try and see if by not setting Type to either addressbook or contact, and just triggering synchronize
action, should give us both contacts and addressbooks in one go.
Verify that it works that way. If it doesn't work feel free to close issue.